Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

login script for every user does not work

Avatar of 1Tsupp
1Tsupp asked on
LinuxShell Scripting
19 Comments1 Solution1043 ViewsLast Modified:
I want files to be copied for every user when they log in to RHEL 5 workstation.
I modified /etc/gdm/PostLogin/Default to execute a script.
This script works if run manually in the terminal by a user account after logging in.
However although it appears to be run when they log in, it does not copy the files and I cannot see any reason why. The echo statements were added for debugging and /var/log/login.log shows it is executed when a user logs in except no files are copied to the home directory.
What am I missing here and how can I debug why files are not being copied?
localroot="root"
if [ $USER != $localroot ]
then
 date
 echo "   ---Not root" >>/dev/null
 echo "   ---`date` Not root" >>/var/log/login.log
 if [ ! -d /home/$USER/.mplayer ]
  then
   echo "   ---setting up mplayer PostLogin to /home/$USER" >>/var/log/login.log
   `/bin/cp -Rd /etc/skel/.mplayer /home/$USER/`
   `/bin/chown -R $USER /home/$USER/.mplayer`
  fi
 if [ ! -d /home/$USER/.mozilla ]
  then
   echo "   ---setting up mozilla PostLogin to /home/$USER" >>/var/log/login.log
   `/bin/cp -Rd /etc/skel/.mozilla /home/$USER/`
   `/bin/chown -R $USER /home/$USER/.mozilla`
  fi
else
 echo "   --- ROOT user" >>/dev/null
fi
exit 0
ASKER CERTIFIED SOLUTION
Avatar of brutuz
brutuz

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Commented:
This problem has been solved!
Unlock 1 Answer and 19 Comments.
See Answers