Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have transmission as a start-up application. I use the command transmission -m to start it up. How can I quit transmission automatically when I'm shutting down?

The problems I'm facing is how to bring the running program to the foreground and send a quit command to it with a shell script? Or send a quit command without bringing it to the foreground?

share|improve this question

For a simple way you can create a .bash_logout file in your home dir that tells transmission to quit, e.g.:

transmission -q


transmission --quit

If the system does not run the .bash_logout, add it to /etc/gdm/PostSession/Default so it executes the logout script properly.

Another way is to add your command to the file /etc/gdm/PostSession/Default before the exit 0 line.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.