Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
My shutdown script won't run
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
g4c9z
Apprentice
Apprentice


Joined: 03 Jun 2004
Posts: 178

PostPosted: Tue Jun 15, 2004 12:19 am    Post subject: My shutdown script won't run Reply with quote

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
View user's profile Send private message
jftuga
Tux's lil' helper
Tux's lil' helper


Joined: 21 Jan 2004
Posts: 139
Location: Athens, GA

PostPosted: Tue Jun 15, 2004 3:54 am    Post subject: Reply with quote

You could incorporate your code into /etc/init.d/halt.sh or into /etc/conf.d/local.stop

-John
Back to top
View user's profile Send private message
g4c9z
Apprentice
Apprentice


Joined: 03 Jun 2004
Posts: 178

PostPosted: Tue Jun 15, 2004 3:21 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum