Where to set a bash script at login (even for new users)?

Asked by François Tissandier

I want to run a bash script when users log in, so that we automatically add their shares to the fav places in Nautilus.

As the computers use Likewise to authenticate on an Active Directory, the accounts are not always existing in the /home.
So it's not possible to add the script to a file in /home/login

As I need to find which shares are allowed for the user, I need to have his login when running the script.
So I cannot run it before the user has logged in.

Do you know where I could do that ? Thanks in advance !

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

System -> Preferences -> Startup items

http://www.addictivetips.com/wp-content/uploads/2009/06/load-startup-application1.png

Add a new item and make it run the script of your choosing by clicking add. If you use KDE you can simply copy (or symlink) the script in ~/.kde/Autostart

Thanks

Revision history for this message
François Tissandier (baloo) said :
#2

Thanks for your answer, but I already know this solution.

However:
"the accounts are not always existing in the /home"

It means that a new user may use the computer and connect for the first time using the AD login/password. It should then run the script. Your solution works, but only after a first login. I want this to be entirely automatic.

I found some potential solutions:
I put the script in the /etc/profile.d folder, but it's running, but it's not working properly. The "gvfs-mount" command fails. I tried to run "dbus-launch bash" before, but it just doesn't do anything. I guess the script is maybe running too early.

Should I try another solution?

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#3

the gvs will need to run after logon

if you look in /etc/skel you could add stuff there maybe, that is one folder where default profiles live, changes to that folder will afect all user profiles as they are generated when they log in for the first time.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#4

Can you help with this problem?

Provide an answer of your own, or ask François Tissandier for more information if necessary.

To post a message you must log in.