Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
detecting reboot in rc script
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
tomalok
n00b
n00b


Joined: 11 Jul 2002
Posts: 30

PostPosted: Mon Nov 25, 2002 11:33 pm    Post subject: detecting reboot in rc script Reply with quote

I have an rc script that takes a long time to 'stop'. However, when rebooting or shutting down, the stuff that 'stop' does doesn't really need to be done.

Is there a way with the gentoo rc script system (etc.) that I can detect whether or not the system's going to halt/reboot?
Back to top
View user's profile Send private message
lx
Veteran
Veteran


Joined: 28 May 2002
Posts: 1012
Location: Netherlands

PostPosted: Tue Nov 26, 2002 11:18 am    Post subject: Reply with quote

runlevel returns previous and current runlevel, so you could parse the outcome to check the current runlevel to see if it's 0 or 6. The man runlevel states that it's also available as variable RUNLEVEL and PREVLEVEL, but I haven't checked this,

Hope this helps,

Cya lX.
_________________
"Remember there's a big difference between kneeling down and bending over.", Frank Zappa
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming 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