Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Gentoo User (http://www.linux-archive.org/gentoo-user/)
-   -   Emergency shutdown, how to? (http://www.linux-archive.org/gentoo-user/63238-emergency-shutdown-how.html)

Michael Schmarck 04-03-2008 04:51 AM

Emergency shutdown, how to?
 
Neil Bothwick <neil@digimed.co.uk> wrote:

> On Wed, 02 Apr 2008 19:40:37 +0200, Michael Schmarck wrote:
>
>> > Neil even proposed ALT +
>> > SysRq + EISUB, to be sure everything is killed, sync'd and
>> > unmounted.
>>
>> Which might or might not work. But note that I was also talking
>> about applications being in a corrupted state (the database example).
>
> E sends a SIGTERM to all applications. Any well behaved application
> should shut down cleanly on this.

No doubt :) But if the app hangs, it might not respond to TERM.

> I sends a SIGKILL, but it only affects
> programs that were so locked up they ignored E, so you have nothing to
> lose by then.

Correct.

But nonetheless, there's still the risk that the KILL has
destroyed the application database (sort of - more correctly:
that the application and its database was in a "non consistent"
state when it received the signal).

Michael

--
gentoo-user@lists.gentoo.org mailing list

Neil Bothwick 04-03-2008 08:41 AM

Emergency shutdown, how to?
 
On Thu, 03 Apr 2008 06:51:28 +0200, Michael Schmarck wrote:

> But nonetheless, there's still the risk that the KILL has
> destroyed the application database (sort of - more correctly:
> that the application and its database was in a "non consistent"
> state when it received the signal).

Yes, but in that case the application has already failed, otherwise it
would have shut down on TERM. Emergency shutdowns aren't about
eliminating any problems in the case of a serious system hang, they are
about minimising such damage.


--
Neil Bothwick

One of the nice things about standards is that there are so many of them.

Michael Schmarck 04-03-2008 08:56 AM

Emergency shutdown, how to?
 
Neil Bothwick <neil@digimed.co.uk> wrote:

> On Thu, 03 Apr 2008 06:51:28 +0200, Michael Schmarck wrote:
>
>> But nonetheless, there's still the risk that the KILL has
>> destroyed the application database (sort of - more correctly:
>> that the application and its database was in a "non consistent"
>> state when it received the signal).
>
> Yes, but in that case the application has already failed, otherwise it
> would have shut down on TERM.

Maybe it would have recoverd in "due time". The chances are pretty
slim, but they are >0.

> Emergency shutdowns aren't about
> eliminating any problems in the case of a serious system hang, they are
> about minimising such damage.

Absolutely correct! But Liviu asked, if there's a potential risk
to the system.

My answer is: Yes, there is! It is pretty low (for the reasons
you mentioned), but it is not 0.

Michael

--
gentoo-user@lists.gentoo.org mailing list

Steven Lembark 04-03-2008 04:10 PM

Emergency shutdown, how to?
 
> Basically, this is not intended to be used to shutdown a puter on a
> regular basis, unless you burn out P/S's on a daily basis. O-o
>
> Just didn't want someone to be using this on a regular basis and then
> wondering why their system has a new nickname, FUBAR. :'(

In most cases you'll find that 'shutdown -h now'
takes only a few seconds. If you're typing againsed
the clock and don't to it every day then the SysReq
tecnhique is somewhat error prone.

In most cases the stuff that can't handle a
crash tends to live at higher runlevels anyway
and gets stopped when you exit rl 3; stuff that
gets started at boot time are more likely
service daemons that can easily handle a reset.
Even if your shutdown croaks halfway through
the stuff, chances are that got shut down first
was the most fragile anyway (e.g., databases
that had to flush cache) and you got whatever
you could cleaned up however fast you could do
it and you live with the rest on restart.

--
Steven Lembark +1 888 359 3508
Workhorse Computing 85-09 90th St
lembark@wrkhors.com Woodhaven, NY 11421
--
gentoo-user@lists.gentoo.org mailing list

Dale 04-03-2008 06:15 PM

Emergency shutdown, how to?
 
Steven Lembark wrote:


> Basically, this is not intended to be used to shutdown a puter on a
> regular basis, unless you burn out P/S's on a daily basis. O-o
>
> Just didn't want someone to be using this on a regular basis and then
> wondering why their system has a new nickname, FUBAR. :'(

In most cases you'll find that 'shutdown -h now'
takes only a few seconds. If you're typing againsed
the clock and don't to it every day then the SysReq
tecnhique is somewhat error prone.

In most cases the stuff that can't handle a
crash tends to live at higher runlevels anyway
and gets stopped when you exit rl 3; stuff that
gets started at boot time are more likely
service daemons that can easily handle a reset.
Even if your shutdown croaks halfway through
the stuff, chances are that got shut down first
was the most fragile anyway (e.g., databases
that had to flush cache) and you got whatever
you could cleaned up however fast you could do
it and you live with the rest on restart.




Well, this one takes longer. Just the foldingathome takes about 20
seconds or more to shutdown. It can take over 60 seconds at times.
That service for some reason has to completely shutdown before the
others start to shutdown. The others will shutdown in parallel like I
have set up. Then there is all the other services that have to stop.
Quite literally, I only had seconds to shutdown since the P/S was
stinking like a skunk. I just needed to umnount the file systems and
power off as fast as possible. I didn't want to just pull the plug but
I needed a shutdown that fast.


Dale

:-) :-)
--

gentoo-user@lists.gentoo.org mailing list

Steven Lembark 04-03-2008 07:38 PM

Emergency shutdown, how to?
 
> Well, this one takes longer. Just the foldingathome takes about 20
> seconds or more to shutdown. It can take over 60 seconds at times.
> That service for some reason has to completely shutdown before the
> others start to shutdown. The others will shutdown in parallel like I
> have set up. Then there is all the other services that have to stop.
> Quite literally, I only had seconds to shutdown since the P/S was
> stinking like a skunk. I just needed to umnount the file systems and
> power off as fast as possible. I didn't want to just pull the plug but
> I needed a shutdown that fast.

Hackint the shutdowns to background the shutdown
op and return is usually pretty simple -- don't know
why more app's don't do that by default.

'halt' will get you down with little typing if you
want to bypass the init scripts; so will "kill -TERM 1".
Add a 'sync' before either of them and you'll probably
be able to come up with minimal trouble.

--
Steven Lembark +1 888 359 3508
Workhorse Computing 85-09 90th St
lembark@wrkhors.com Woodhaven, NY 11421
--
gentoo-user@lists.gentoo.org mailing list

Iain Buchanan 04-04-2008 12:28 AM

Emergency shutdown, how to?
 
On Thu, 2008-04-03 at 10:56 +0200, Michael Schmarck wrote:
> Neil Bothwick <neil@digimed.co.uk> wrote:

> > Emergency shutdowns aren't about
> > eliminating any problems in the case of a serious system hang, they are
> > about minimising such damage.
>
> Absolutely correct! But Liviu asked, if there's a potential risk
> to the system.
>
> My answer is: Yes, there is! It is pretty low (for the reasons
> you mentioned), but it is not 0.

The risk is not 0, but the risk is not greater than "doing nothing", in
fact the risk of an emergency shutdown is less than "doing nothing",
given the fact that this is an emergency, and if you do nothing, you
will probably have greater problems (file system corruption, etc).
--
Iain Buchanan <iaindb at netspace dot net dot au>

I read the newspaper avidly. It is my one form of continuous fiction.
-- Aneurin Bevan

--
gentoo-user@lists.gentoo.org mailing list

Iain Buchanan 04-04-2008 12:29 AM

Emergency shutdown, how to?
 
On Thu, 2008-04-03 at 12:10 -0400, Steven Lembark wrote:

> In most cases you'll find that 'shutdown -h now'
> takes only a few seconds.

you must have nice hardware :)
--
Iain Buchanan <iaindb at netspace dot net dot au>

flannister, n.:
The plastic yoke that holds a six-pack of beer together.
-- "Sniglets", Rich Hall & Friends

--
gentoo-user@lists.gentoo.org mailing list

Dale 04-04-2008 12:45 AM

Emergency shutdown, how to?
 
Steven Lembark wrote:


> Well, this one takes longer. Just the foldingathome takes about 20
> seconds or more to shutdown. It can take over 60 seconds at times.
> That service for some reason has to completely shutdown before the
> others start to shutdown. The others will shutdown in parallel like I
> have set up. Then there is all the other services that have to stop.
> Quite literally, I only had seconds to shutdown since the P/S was
> stinking like a skunk. I just needed to umnount the file systems and
> power off as fast as possible. I didn't want to just pull the plug but
> I needed a shutdown that fast.

Hackint the shutdowns to background the shutdown
op and return is usually pretty simple -- don't know
why more app's don't do that by default.

'halt' will get you down with little typing if you
want to bypass the init scripts; so will "kill -TERM 1".
Add a 'sync' before either of them and you'll probably
be able to come up with minimal trouble.



What's the difference between halt command and shutdown? I thought they
were basically the same thing.


Also, in case you missed it. I have a service, foldingathome, that
takes a while to stop and no other service can be stopped in parallel
with this one. That is one of my key sticking points with the
shutdown. Most of the others are pretty fast. I just needed the
quickest *clean* shutdown I could get.


Thanks

Dale

:-) :-)
--

gentoo-user@lists.gentoo.org mailing list

Dale 04-04-2008 01:00 AM

Emergency shutdown, how to?
 
Iain Buchanan wrote:

On Thu, 2008-04-03 at 12:10 -0400, Steven Lembark wrote:



In most cases you'll find that 'shutdown -h now'
takes only a few seconds.



you must have nice hardware :)



He must have. I have a AMD 2500+ CPU with 1Gb of ram. It's not the
slowest but not the fastest either.


Dale

:-) :-)
--

gentoo-user@lists.gentoo.org mailing list


All times are GMT. The time now is 03:40 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.