When I shut down my computer I want to show some pending tasks that I have to do before leaving the office... I did a local application to manage those tasks, basically I just want to run a command, and shut down after I kill the app executed.
|
|
You could add your command to the file |
|||||
|
|
Sounds like a question for superuser.com to me. Anyway, after some Googling I found How to run a script on logout? which says to add the script to $HOME/.bash_logout. If that doesn't work, add
to /etc/gdm/PostSession/Default so it executes the logout script properly. Seeing as before shutdown the user is logged off anyway, this should cover both bases. |
|||||||||
|
|
You can do this by creating a script in /etc/rc0.d (for shutdown) and /etc/rc6.d (for reboot). To do this, run:
Edit your shutdown script in the text editor then run:
And if you want it to run on reboot also then run this:
Source: this forum thread |
||||
|
If you do |
|||||
|
|
Almost same answer than Tommy Brunn but without the risk to hang with being asked the root password :
|
|||
|
|