Unix Technical Forum

Cancel Shutdown

This is a discussion on Cancel Shutdown within the Slackware Linux Support forums, part of the Unix Operating Systems category; --> i'd like to write some lines of script in the /etc/rc.0 and let it detect some conditions, if not ...


Go Back   Unix Technical Forum > Unix Operating Systems > Slackware Linux Support

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-20-2008, 09:57 AM
Steven Woody
 
Posts: n/a
Default Cancel Shutdown


i'd like to write some lines of script in the /etc/rc.0 and let it detect some
conditions, if not hold, i wanna cancel the shutdow procedure by 'exit
non-zero'. but i found this idea simply does _not_ work.

is there any legel way to implement this?

--
steven woody (id: narke)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-20-2008, 09:57 AM
Sebastian Stein
 
Posts: n/a
Default Re: Cancel Shutdown

Steven Woody <anti-spam.narkewoody@gmail.com.dont-post-to> wrote:
> i'd like to write some lines of script in the /etc/rc.0 and let it detect some
> conditions, if not hold, i wanna cancel the shutdow procedure by 'exit
> non-zero'. but i found this idea simply does _not_ work.


I solved this problem by creating a script named shutdown. I put this script in
a bin folder, which is searched before /sbin/. No each time I like to get the
system down, I just call shutdown and performs the necessary checks. Afterwards
it calls shutdown -h now. However, this solution does not work, if the user
presses Ctrl+Alt+Del.

Sebastian
--
http://www.halle-ist-schoen.de/
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-20-2008, 09:57 AM
Mark Hill
 
Posts: n/a
Default Re: Cancel Shutdown

On Tue, 20 Sep 2005 18:47:28 +0200,
Sebastian Stein <seb_stein@gmx.de> wrote:

[custom shutdown script]
> Afterwards
> it calls shutdown -h now. However, this solution does not work, if the user
> presses Ctrl+Alt+Del.


The file /etc/inittab controls what program is invoked when Ctrl+Alt+Del
is performed. You should be able to edit /etc/inittab so that your
shutdown script is invoked instead of /sbin/shutdown.

--
Mark Hill
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-20-2008, 10:00 AM
Sebastian Stein
 
Posts: n/a
Default Re: Cancel Shutdown

Mark Hill <m@rk.invalid> wrote:
>> Afterwards
>> it calls shutdown -h now. However, this solution does not work, if the user
>> presses Ctrl+Alt+Del.

>
> The file /etc/inittab controls what program is invoked when Ctrl+Alt+Del
> is performed. You should be able to edit /etc/inittab so that your
> shutdown script is invoked instead of /sbin/shutdown.


Oh yeah, that's true, so I can directly put the call there!

Sebastian
--
http://www.halle-ist-schoen.de/
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:14 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com