1

My problem is following:
I want to modify my login/logout so if I login a program is started, if I log off, it is closed (which it isn’t usually). (To let you know what I’m talking about – it’s dropbox)

Firstly, I have no root-access to the machine I’m working on.
Secondly, I’m aware I can just start the dropbox each time I log on and make an alias for example for the logout, so if I logout an additional command is executed.

If there is no other way to do this ok, but what I would like to do is: modify the login and logout so, that if I login/logout as usual, the dropbox is started/stopped automatically. Is there any other way to do this? My rights are restricted to my home-directory.

0

2 Answers 2

0

If you are using bash then commands in ~/.bash_login are executed on log in and those in ~/.bash_logout are executed on log out/off if these files exists.

If you happen to have a ~/.bash_profile file that is readable, then that takes precedence over ~/.bash_login and only that file is processed.


If you use tcsh, you can put the command to start dropbox in ~/.tcshrc (or ~/.cshrc if it exists, or ~/.login) and for it to stop in ~/.logout.

For tcsh the order in which the files on login are read can differ depending on how the shell is compiled (and which can be checked with echo $version)

6
  • sadly I dont have theses files in my home-directory. Additionally - wouldn't this run just if I use the bash? (tcsh is standard on the machine) Commented Apr 9, 2015 at 14:06
  • @groebsgr bash would need to be your login shell for them to work Commented Apr 9, 2015 at 14:16
  • @groebsgr I update the answer with info for tcsh Commented Apr 9, 2015 at 14:29
  • sadly there are none of these files in my homedirectory - i suppose on purpose by the administration. Nevertheless thank you very much so far! Commented Apr 9, 2015 at 14:40
  • @groebsgr you can create the files yourself, tcsh is unlikely to be compiled in a way that it ignores the files. Just make them and put an echo statement in to see if they work, then go from there. Commented Apr 9, 2015 at 14:44
0

In a terminal run

gnome-session-properties 

Add dropbox to the list of start up applications.

1
  • I just tried it - the start seems to work fine with this, any ideas to stop the program at logout? A quick idea would be to make the command in the given properties so it stops dropbox if i logout, but i have to try this. Commented Apr 9, 2015 at 14:07

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.