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

How to trigger a program when shutdown occurs and trigger the another program when login occurs in Ubuntu

share|improve this question
Have You tried such solution – Misery Feb 10 '12 at 12:34

If you want to run in shutdown you should add your script file into /etc/rc6.d/. If you want to run the things in reboot you should add you script file to /etc/rc0.d/.

Make sure at the first of your script file name should be K99. After creating your script file run chmod +x K99Something to give neccessary permission.

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.