Monday, May 24, 2010

run a script at logout/shutdown on ubuntu Lucid Lynx 10.04

how to make script run at logout (caution: this method is recommended for admin level tasks to be run on the machine before logout/shutdown):

If the script name is fooOnLogout.sh, then do the following steps (also make sure that the script is executable):

sudo cp fooOnLogout.sh /etc/init.d
sudo ln -s /etc/init.d/fooOnLogout.sh /etc/rc0.d/K10fooOnLogout.sh
sudo ln -s /etc/init.d/fooOnLogout.sh /etc/rc6.d/K10fooOnLogout.sh

No comments:

Post a Comment