Create your shell script in /etc/init.d-- let's suppose for purposes of this example you're going to call the script "screenshutdown". Then you have to make links to the script in the various /etc/rc?.d directories:
Code:
for d in /etc/rc?.d; do
ln -s /etc/init.d/screenshutdown $d/S99screenshutdown
done
The link to the script in the approrpriate /etc/rc?.d directory is what causes it to be executed when the system shuts down.
You might find this thread helpful for explaining the role of these various directories in the system boot process:
http://ubuntuforums.org/showpost.php...68&postcount=2
Bookmarks