View previous topic :: View next topic |
Author |
Message |
g4c9z Apprentice
Joined: 03 Jun 2004 Posts: 178
|
Posted: Tue Jun 15, 2004 12:19 am Post subject: My shutdown script won't run |
|
|
Hello,
I am trying to get a script to run whenever my computer shuts down (enters runlevel 0). I put this in /etc/inittab:
ht:0:wait:/root/bin/onhalt
But it didn't run. When I typed the command normally it did. How can that be?
What's the proper way to run a program at shutdown? Maybe doing that would work instead. |
|
Back to top |
|
|
jftuga Tux's lil' helper
Joined: 21 Jan 2004 Posts: 139 Location: Athens, GA
|
Posted: Tue Jun 15, 2004 3:54 am Post subject: |
|
|
You could incorporate your code into /etc/init.d/halt.sh or into /etc/conf.d/local.stop
-John |
|
Back to top |
|
|
g4c9z Apprentice
Joined: 03 Jun 2004 Posts: 178
|
Posted: Tue Jun 15, 2004 3:21 pm Post subject: |
|
|
Thanks. I got it working now. The problem was that I put the entry at the end of inittab. Gentoo already had another script being run for runlevel 0, and since the commands are run in the order they appear in inittab, that one ran first. It also turns off my computer, eliminating any hope of my command running. When I put it at the start of the file it worked.
I guess you have to be careful with these things. |
|
Back to top |
|
|
|