PDA

View Full Version : [ubuntu] Login script for Ubuntu



Jaxilian
February 5th, 2014, 01:54 PM
Hi
I am trying to get a login script to work in my Ubuntu 12.04 machine and the script is a bash script that uses the variable $USER.

Problem is I can't find a spot to put it so all users that login can run it when they login.

On Gnome is was easy with /etc/gdm/PostLogin but Lightdm doesn't seem have that functionality. I tried with lightdm.conf and added the line session-setup-script = /usr/local/scripts/Loginscript.sh but it does only so I cannot login graphically at all. The script is executable.

Anyone know how to do this? I seen many posts, but most is about a single user using the machine and not many.

dargaud2
February 5th, 2014, 04:38 PM
For any kind of login, you can put your script in /etc/profile.d/, but if you are only looking to run something for a graphical login (Gnome/Unity/KDE), I don't know as it likely depends on the window manager. Or maybe, like you said, something in LightDM.

Jaxilian
March 19th, 2014, 10:38 AM
Thanks it worked very well

ian-weisser
March 19th, 2014, 04:02 PM
If you want all users to run it as a user-level Upstart job, you put the trigger in /usr/share/upstart/sessions/