Execute script before shutting down in Ubuntu
Posted
by
juanefren
on Super User
See other posts from Super User
or by juanefren
Published on 2010-08-10T18:45:41Z
Indexed on
2011/01/29
23:28 UTC
Read the original article
Hit count: 210
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, so basically I just want to run a command, and shut down after I kill the app executed.
I have already tried with these options:
* /etc/gdm/PostSession/Default --> this works only when I select LogOut option instead Shutdown.
* /etc/rc0.d/K01mycustomscript --> execute script after X is killed
* $HOME/.bash_logout --> This looks like does nothing.
* ./app-to-run && sudo shutdown -h now --> Don't like it for 2 reasons, prompts for sudo password, and can't use my laptop shutdown button.
I am using Ubuntu 10.04
© Super User or respective owner