Run command on forced shutdown
I'm looking for information on how to run a command when the system is shut down. Specifically, when the power button on the front of the case is pressed and the system is forced to shut down. Is there any way to differentiate between the types of shutdown? And how do I go about having a command become a part of the shutdown procedure?
Thank you |
Hi,
I know with RedHat that when changing to runlevel 0 (halt) - It runs the following script /etc/rc.d/init.d/halt I'm sure there is a much better way of executing commands at shutdown, rather then hacking at this script. Wether or not you can differentiate between different types of shutdowns, I don't know. Hopefully this gets you pointed in the right direction. EDIT: Just saw in you're profile that you are using Slackware. I don't have a Slackware box infront of me (I do at home), but take a look around the /etc/rc.d directory and subdirectories, I'm sure you will find something in there. -Kristijan |
I'm running Mandriva now, actually, (should prbably update that, haha) but I'm thinking it still should use the same shutdown procedure. I'll give init.d/halt a try
Thanks for your help |
man acpid
|
All times are GMT -5. The time now is 02:27 AM. |