public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] Emergency shutdown, how to?
@ 2008-03-28  7:33 Dale
  2008-03-28  7:41 ` Daniel Pielmeier
  2008-03-28  7:42 ` Dirk Heinrichs
  0 siblings, 2 replies; 54+ messages in thread
From: Dale @ 2008-03-28  7:33 UTC (permalink / raw
  To: gentoo-user

Hi,

I had a problem the other day where I needed to shutdown, like in a real 
hurry.  My power supply was packed up and checking out without paying 
the bill.  I was in KDE and just selected logout then shutdown from the 
menu.  Is there a faster way to shutdown so that at least the file 
system is clean?  Some fancy keystroke pattern or a short command 
maybe?  I run foldingathome and that pesky "waiting 17 seconds" thing 
was torture.  I need it to bypass that little "feature" as well. 

I hope I never run into this again but just in case I would like a 
pointer.  It did make it to the point where it said it was unmounting 
file systems but one partition must have been mounted since it was well, 
pissed, about not being unmounted cleanly.  ;-)  Thank goodness for 
reiserfs coming to the rescue.  After putting in a new P/S all is well 
again. 

Thanks.

Dale

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



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [gentoo-user] Emergency shutdown, how to?
  2008-03-28  7:33 [gentoo-user] Emergency shutdown, how to? Dale
@ 2008-03-28  7:41 ` Daniel Pielmeier
  2008-03-28  7:46   ` Dirk Heinrichs
  2008-03-28  7:42 ` Dirk Heinrichs
  1 sibling, 1 reply; 54+ messages in thread
From: Daniel Pielmeier @ 2008-03-28  7:41 UTC (permalink / raw
  To: gentoo-user

2008/3/28, Dale <dalek1967@bellsouth.net>:
> Hi,
>
> I had a problem the other day where I needed to shutdown, like in a real
> hurry.  My power supply was packed up and checking out without paying
> the bill.  I was in KDE and just selected logout then shutdown from the
> menu.  Is there a faster way to shutdown so that at least the file
> system is clean?  Some fancy keystroke pattern or a short command
> maybe?  I run foldingathome and that pesky "waiting 17 seconds" thing
> was torture.  I need it to bypass that little "feature" as well.
>
> I hope I never run into this again but just in case I would like a
> pointer.  It did make it to the point where it said it was unmounting
> file systems but one partition must have been mounted since it was well,
> pissed, about not being unmounted cleanly.  ;-)  Thank goodness for
> reiserfs coming to the rescue.  After putting in a new P/S all is well
> again.

You can try this one: http://en.wikipedia.org/wiki/Magic_SysRq_key

Regards,

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



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [gentoo-user] Emergency shutdown, how to?
  2008-03-28  7:33 [gentoo-user] Emergency shutdown, how to? Dale
  2008-03-28  7:41 ` Daniel Pielmeier
@ 2008-03-28  7:42 ` Dirk Heinrichs
  1 sibling, 0 replies; 54+ messages in thread
From: Dirk Heinrichs @ 2008-03-28  7:42 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 531 bytes --]

Am Freitag, 28. März 2008 schrieb ext Dale:

> Is there a faster way to shutdown so that at least the file
> system is clean?

Read /usr/src/linux/Documentation/sysrq.txt.

HTH...

	Dirk
-- 
Dirk Heinrichs          | Tel:  +49 (0)162 234 3408
Configuration Manager   | Fax:  +49 (0)211 47068 111
Capgemini Deutschland   | Mail: dirk.heinrichs@capgemini.com
Wanheimerstraße 68      | Web:  http://www.capgemini.com
D-40468 Düsseldorf      | ICQ#: 110037733
GPG Public Key C2E467BB | Keyserver: www.keyserver.net

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [gentoo-user] Emergency shutdown, how to?
  2008-03-28  7:41 ` Daniel Pielmeier
@ 2008-03-28  7:46   ` Dirk Heinrichs
  2008-03-28  7:51     ` Daniel Pielmeier
  0 siblings, 1 reply; 54+ messages in thread
From: Dirk Heinrichs @ 2008-03-28  7:46 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 604 bytes --]

Am Freitag, 28. März 2008 schrieb ext Daniel Pielmeier:

> You can try this one: http://en.wikipedia.org/wiki/Magic_SysRq_key

Wow, good to know that Wikipedia has it, just in case I don't have kernel 
sources installed on my Gentoo systems ;-)

Bye...

	Dirk
-- 
Dirk Heinrichs          | Tel:  +49 (0)162 234 3408
Configuration Manager   | Fax:  +49 (0)211 47068 111
Capgemini Deutschland   | Mail: dirk.heinrichs@capgemini.com
Wanheimerstraße 68      | Web:  http://www.capgemini.com
D-40468 Düsseldorf      | ICQ#: 110037733
GPG Public Key C2E467BB | Keyserver: www.keyserver.net

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [gentoo-user] Emergency shutdown, how to?
  2008-03-28  7:46   ` Dirk Heinrichs
@ 2008-03-28  7:51     ` Daniel Pielmeier
  2008-03-28  8:07       ` Dale
  2008-03-28  8:29       ` Neil Bothwick
  0 siblings, 2 replies; 54+ messages in thread
From: Daniel Pielmeier @ 2008-03-28  7:51 UTC (permalink / raw
  To: gentoo-user

2008/3/28, Dirk Heinrichs <dirk.heinrichs.ext@nsn.com>:
> Am Freitag, 28. März 2008 schrieb ext Daniel Pielmeier:
>
> > You can try this one: http://en.wikipedia.org/wiki/Magic_SysRq_key
>
> Wow, good to know that Wikipedia has it, just in case I don't have kernel
> sources installed on my Gentoo systems ;-)
>

Yeah, i think it is a bit more readable than the kernel documentation. ;-)

By the way the safest and recommended command, although a bit longish
should be ALT+SysRq(or print)+S(ync)+U(mount)+B(Reboot).

Regards,

Daniel

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [gentoo-user] Emergency shutdown, how to?
  2008-03-28  7:51     ` Daniel Pielmeier
@ 2008-03-28  8:07       ` Dale
  2008-03-28  8:11         ` Dirk Heinrichs
  2008-04-02 13:36         ` Liviu Andronic
  2008-03-28  8:29       ` Neil Bothwick
  1 sibling, 2 replies; 54+ messages in thread
From: Dale @ 2008-03-28  8:07 UTC (permalink / raw
  To: gentoo-user

Daniel Pielmeier wrote:
> 2008/3/28, Dirk Heinrichs <dirk.heinrichs.ext@nsn.com>:
>   
>> Am Freitag, 28. März 2008 schrieb ext Daniel Pielmeier:
>>
>>     
>>> You can try this one: http://en.wikipedia.org/wiki/Magic_SysRq_key
>>>       
>> Wow, good to know that Wikipedia has it, just in case I don't have kernel
>> sources installed on my Gentoo systems ;-)
>>
>>     
>
> Yeah, i think it is a bit more readable than the kernel documentation. ;-)
>
> By the way the safest and recommended command, although a bit longish
> should be ALT+SysRq(or print)+S(ync)+U(mount)+B(Reboot).
>
> Regards,
>
> Daniel
> ����z�b�� z{h�����x%ist=


Since I wanted to shutdown instead of reboot, it would be ALT + SysRq + 
S + U + O then correct?  I have never done this before so what if any 
are the gotcha's with this?  Anybody ever do it and can tell me how long 
a shutdown takes?  Is it like seconds or what?  Also, will this work if 
I am logged into KDE and in the GUI? 

Thanks.

Dale

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



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [gentoo-user] Emergency shutdown, how to?
  2008-03-28  8:07       ` Dale
@ 2008-03-28  8:11         ` Dirk Heinrichs
  2008-03-28 10:12           ` Michal 'vorner' Vaner
  2008-04-02 13:36         ` Liviu Andronic
  1 sibling, 1 reply; 54+ messages in thread
From: Dirk Heinrichs @ 2008-03-28  8:11 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 679 bytes --]

Am Freitag, 28. März 2008 schrieb ext Dale:
> I have never done this before so what if any
> are the gotcha's with this?

None.

> Anybody ever do it and can tell me how long 
> a shutdown takes?

As long as you need to strike the keys.

> Also, will this work if 
> I am logged into KDE and in the GUI?

Yes.

Bye...

	Dirk
-- 
Dirk Heinrichs          | Tel:  +49 (0)162 234 3408
Configuration Manager   | Fax:  +49 (0)211 47068 111
Capgemini Deutschland   | Mail: dirk.heinrichs@capgemini.com
Wanheimerstraße 68      | Web:  http://www.capgemini.com
D-40468 Düsseldorf      | ICQ#: 110037733
GPG Public Key C2E467BB | Keyserver: www.keyserver.net

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [gentoo-user] Emergency shutdown, how to?
  2008-03-28  7:51     ` Daniel Pielmeier
  2008-03-28  8:07       ` Dale
@ 2008-03-28  8:29       ` Neil Bothwick
  2008-03-28 11:09         ` Dale
  1 sibling, 1 reply; 54+ messages in thread
From: Neil Bothwick @ 2008-03-28  8:29 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 404 bytes --]

On Fri, 28 Mar 2008 08:51:20 +0100, Daniel Pielmeier wrote:

> By the way the safest and recommended command, although a bit longish
> should be ALT+SysRq(or print)+S(ync)+U(mount)+B(Reboot).

Alt-SysRq E I S U B is better as it kills running processes first. If you
have time, pause between the keystrokes to give them time to work.


-- 
Neil Bothwick

Are Cheerios really doughnut seeds?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [gentoo-user] Emergency shutdown, how to?
  2008-03-28  8:11         ` Dirk Heinrichs
@ 2008-03-28 10:12           ` Michal 'vorner' Vaner
  0 siblings, 0 replies; 54+ messages in thread
From: Michal 'vorner' Vaner @ 2008-03-28 10:12 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 525 bytes --]

Hello

On Fri, Mar 28, 2008 at 09:11:53AM +0100, Dirk Heinrichs wrote:
> > Anybody ever do it and can tell me how long 
> > a shutdown takes?
> 
> As long as you need to strike the keys.

Not really true. I have set my dirty cache timeout to 10 minutes, so it
can hold some few hundred megabytes of unsynced data (happens rarely),
so it can take like 10 seconds to dump them to disk.

But with clean cache, it is as fast as hitting a hard switch.

-- 
Hallowed be the zeroes and ones

Michal 'vorner' Vaner

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [gentoo-user] Emergency shutdown, how to?
  2008-03-28  8:29       ` Neil Bothwick
@ 2008-03-28 11:09         ` Dale
  0 siblings, 0 replies; 54+ messages in thread
From: Dale @ 2008-03-28 11:09 UTC (permalink / raw
  To: gentoo-user

Neil Bothwick wrote:
> On Fri, 28 Mar 2008 08:51:20 +0100, Daniel Pielmeier wrote:
>
>   
>> By the way the safest and recommended command, although a bit longish
>> should be ALT+SysRq(or print)+S(ync)+U(mount)+B(Reboot).
>>     
>
> Alt-SysRq E I S U B is better as it kills running processes first. If you
> have time, pause between the keystrokes to give them time to work.
>
>
>   


Cooool.  I'll try to grow a pair and test this thing sometime.  This 
sounds like it would be pretty fast.

Thanks.

Dale

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



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [gentoo-user] Emergency shutdown, how to?
  2008-03-28  8:07       ` Dale
  2008-03-28  8:11         ` Dirk Heinrichs
@ 2008-04-02 13:36         ` Liviu Andronic
  2008-04-02 13:44           ` [gentoo-user] " Michael Schmarck
  2008-04-02 15:50           ` [gentoo-user] " Steven Lembark
  1 sibling, 2 replies; 54+ messages in thread
From: Liviu Andronic @ 2008-04-02 13:36 UTC (permalink / raw
  To: gentoo-user

On Fri, Mar 28, 2008 at 10:07 AM, Dale <dalek1967@bellsouth.net> wrote:
> > By the way the safest and recommended command, although a bit longish
> > should be ALT+SysRq(or print)+S(ync)+U(mount)+B(Reboot).
> >
>
>  Since I wanted to shutdown instead of reboot, it would be ALT + SysRq + S +
> U + O then correct?

Are there any potential harms to the hardware / system in case one
tends to abuse (i.e. use more often than necessary) of this command?
It's so often so tempting to shut down your system fast.
Liviu
-- 
gentoo-user@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] 54+ messages in thread

* [gentoo-user]  Re: Emergency shutdown, how to?
  2008-04-02 13:36         ` Liviu Andronic
@ 2008-04-02 13:44           ` Michael Schmarck
  2008-04-02 13:49             ` Dirk Heinrichs
  2008-04-02 15:50           ` [gentoo-user] " Steven Lembark
  1 sibling, 1 reply; 54+ messages in thread
From: Michael Schmarck @ 2008-04-02 13:44 UTC (permalink / raw
  To: gentoo-user

Liviu Andronic <landronimirc@gmail.com> wrote:

> Are there any potential harms to the hardware / system in case one
> tends to abuse (i.e. use more often than necessary) of this command?

You're not shutting down the system in a clean way. Because of
this, filesystem and/or applications might get corrupt (eg. think
of a database, which was in the middle of writing to some of
its tables).

> It's so often so tempting to shut down your system fast.

Yeah, it sure is :)

Michael

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



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [gentoo-user]  Re: Emergency shutdown, how to?
  2008-04-02 13:44           ` [gentoo-user] " Michael Schmarck
@ 2008-04-02 13:49             ` Dirk Heinrichs
  2008-04-02 14:19               ` [gentoo-user] " Michael Schmarck
  0 siblings, 1 reply; 54+ messages in thread
From: Dirk Heinrichs @ 2008-04-02 13:49 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 531 bytes --]

Am Mittwoch, 2. April 2008 schrieb ext Michael Schmarck:

> You're not shutting down the system in a clean way.

You're not? I thought that's the purpose of the whole thing?

Bye...

	Dirk
-- 
Dirk Heinrichs          | Tel:  +49 (0)162 234 3408
Configuration Manager   | Fax:  +49 (0)211 47068 111
Capgemini Deutschland   | Mail: dirk.heinrichs@capgemini.com
Wanheimerstraße 68      | Web:  http://www.capgemini.com
D-40468 Düsseldorf      | ICQ#: 110037733
GPG Public Key C2E467BB | Keyserver: www.keyserver.net

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 54+ messages in thread

* [gentoo-user]  Re: Re: Emergency shutdown, how to?
  2008-04-02 13:49             ` Dirk Heinrichs
@ 2008-04-02 14:19               ` Michael Schmarck
  2008-04-02 14:28                 ` [gentoo-user] " Dirk Heinrichs
  0 siblings, 1 reply; 54+ messages in thread
From: Michael Schmarck @ 2008-04-02 14:19 UTC (permalink / raw
  To: gentoo-user

Dirk Heinrichs <dirk.heinrichs.ext@nsn.com> wrote:

> Am Mittwoch, 2. April 2008 schrieb ext Michael Schmarck:
> 
>> You're not shutting down the system in a clean way.
> 
> You're not? I thought that's the purpose of the whole thing?

It's more like pulling the plug, isn't it? At least none of
the shutdown scripts is run.  And if you don't run ALT + SysRq + U,
or if it just doesn't work (like hangs at some (remote) fs), 
filesystems aren't even unmounted and thus dirty and thus need
a fsck run on next boot.

Michael

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



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [gentoo-user]  Emergency shutdown, how to?
  2008-04-02 14:19               ` [gentoo-user] " Michael Schmarck
@ 2008-04-02 14:28                 ` Dirk Heinrichs
  2008-04-02 14:41                   ` Mark Knecht
                                     ` (2 more replies)
  0 siblings, 3 replies; 54+ messages in thread
From: Dirk Heinrichs @ 2008-04-02 14:28 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 1127 bytes --]

Am Mittwoch, 2. April 2008 schrieb ext Michael Schmarck:
> Dirk Heinrichs <dirk.heinrichs.ext@nsn.com> wrote:
> > Am Mittwoch, 2. April 2008 schrieb ext Michael Schmarck:
> >> You're not shutting down the system in a clean way.
> >
> > You're not? I thought that's the purpose of the whole thing?
>
> It's more like pulling the plug, isn't it? At least none of
> the shutdown scripts is run.  And if you don't run ALT + SysRq + U,
> or if it just doesn't work (like hangs at some (remote) fs),

But nobody proposed _not_ to run ALT + SysRq + U, Neil even proposed ALT + 
SysRq + EISUB, to be sure everything is killed, sync'd and unmounted.

> filesystems aren't even unmounted and thus dirty and thus need
> a fsck run on next boot.

XFS to the rescue :-)

Bye...

	Dirk
-- 
Dirk Heinrichs          | Tel:  +49 (0)162 234 3408
Configuration Manager   | Fax:  +49 (0)211 47068 111
Capgemini Deutschland   | Mail: dirk.heinrichs@capgemini.com
Wanheimerstraße 68      | Web:  http://www.capgemini.com
D-40468 Düsseldorf      | ICQ#: 110037733
GPG Public Key C2E467BB | Keyserver: www.keyserver.net

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [gentoo-user] Emergency shutdown, how to?
  2008-04-02 14:28                 ` [gentoo-user] " Dirk Heinrichs
@ 2008-04-02 14:41                   ` Mark Knecht
  2008-04-02 15:18                   ` Neil Bothwick
  2008-04-02 17:40                   ` [gentoo-user] " Michael Schmarck
  2 siblings, 0 replies; 54+ messages in thread
From: Mark Knecht @ 2008-04-02 14:41 UTC (permalink / raw
  To: gentoo-user

On Wed, Apr 2, 2008 at 7:28 AM, Dirk Heinrichs
<dirk.heinrichs.ext@nsn.com> wrote:
>
>  But nobody proposed _not_ to run ALT + SysRq + U, Neil even proposed ALT +
>  SysRq + EISUB, to be sure everything is killed, sync'd and unmounted.
>

There is actually a Wikipedia page that recommended remembering the
word BUSIER and then executing it backwards:

ALT+SysRq+REISUB

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



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [gentoo-user]  Emergency shutdown, how to?
  2008-04-02 14:28                 ` [gentoo-user] " Dirk Heinrichs
  2008-04-02 14:41                   ` Mark Knecht
@ 2008-04-02 15:18                   ` Neil Bothwick
  2008-04-02 20:58                     ` darren kirby
  2008-04-02 17:40                   ` [gentoo-user] " Michael Schmarck
  2 siblings, 1 reply; 54+ messages in thread
From: Neil Bothwick @ 2008-04-02 15:18 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 452 bytes --]

On Wed, 2 Apr 2008 16:28:29 +0200, Dirk Heinrichs wrote:

> But nobody proposed _not_ to run ALT + SysRq + U, Neil even proposed
> ALT + SysRq + EISUB, to be sure everything is killed, sync'd and
> unmounted.

Just don't try to do E or I over an SSH connection. It kills the SSH
daemon and you can't reboot the box. You can guess how I learned that
one :(


-- 
Neil Bothwick

Windows Error #02: Multitasking attempted. System confused.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [gentoo-user] Emergency shutdown, how to?
  2008-04-02 13:36         ` Liviu Andronic
  2008-04-02 13:44           ` [gentoo-user] " Michael Schmarck
@ 2008-04-02 15:50           ` Steven Lembark
  2008-04-02 17:28             ` Volker Armin Hemmann
  1 sibling, 1 reply; 54+ messages in thread
From: Steven Lembark @ 2008-04-02 15:50 UTC (permalink / raw
  To: gentoo-user

Liviu Andronic wrote:
 > On Fri, Mar 28, 2008 at 10:07 AM, Dale <dalek1967@bellsouth.net> wrote:
 >>> By the way the safest and recommended command, although a bit longish
 >>> should be ALT+SysRq(or print)+S(ync)+U(mount)+B(Reboot).
 >>>
 >>  Since I wanted to shutdown instead of reboot, it would be ALT + SysRq + S +
 >> U + O then correct?
 >
 > Are there any potential harms to the hardware / system in case one
 > tends to abuse (i.e. use more often than necessary) of this command?
 > It's so often so tempting to shut down your system fast.

Short of a serious emergency (e.g., UPS with
30-sec lag and no input power) stick with
'shutdown -fh now'. The main problem is that
you bypass the stop phase of all the app's
started up via init.d; very little short of
just hitting the reset switch or yanking the
power.

-- 
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



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [gentoo-user] Emergency shutdown, how to?
  2008-04-02 15:50           ` [gentoo-user] " Steven Lembark
@ 2008-04-02 17:28             ` Volker Armin Hemmann
  2008-04-02 19:19               ` Dale
  0 siblings, 1 reply; 54+ messages in thread
From: Volker Armin Hemmann @ 2008-04-02 17:28 UTC (permalink / raw
  To: gentoo-user

On Mittwoch, 2. April 2008, Steven Lembark wrote:
> Liviu Andronic wrote:
>  > On Fri, Mar 28, 2008 at 10:07 AM, Dale <dalek1967@bellsouth.net> wrote:
>  >>> By the way the safest and recommended command, although a bit longish
>  >>> should be ALT+SysRq(or print)+S(ync)+U(mount)+B(Reboot).
>  >>
>  >>  Since I wanted to shutdown instead of reboot, it would be ALT + SysRq
>  >> + S + U + O then correct?
>  >
>  > Are there any potential harms to the hardware / system in case one
>  > tends to abuse (i.e. use more often than necessary) of this command?
>  > It's so often so tempting to shut down your system fast.
>
> Short of a serious emergency (e.g., UPS with
> 30-sec lag and no input power) stick with
> 'shutdown -fh now'. The main problem is that
> you bypass the stop phase of all the app's
> started up via init.d; very little short of
> just hitting the reset switch or yanking the
> power.

if you do it the right way, start with 'e' and 'i', all apps are cleanly 
terminated/killed. So if an app does not quit cleanly, it is broken.

The correct sequence is: e,i,u,b/o and it is absolutly save.
-- 
gentoo-user@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] 54+ messages in thread

* [gentoo-user]  Re: Emergency shutdown, how to?
  2008-04-02 14:28                 ` [gentoo-user] " Dirk Heinrichs
  2008-04-02 14:41                   ` Mark Knecht
  2008-04-02 15:18                   ` Neil Bothwick
@ 2008-04-02 17:40                   ` Michael Schmarck
  2008-04-02 17:48                     ` Neil Bothwick
  2 siblings, 1 reply; 54+ messages in thread
From: Michael Schmarck @ 2008-04-02 17:40 UTC (permalink / raw
  To: gentoo-user

· Dirk Heinrichs <dirk.heinrichs.ext@nsn.com>:

> Am Mittwoch, 2. April 2008 schrieb ext Michael Schmarck:
>> Dirk Heinrichs <dirk.heinrichs.ext@nsn.com> wrote:
>> > Am Mittwoch, 2. April 2008 schrieb ext Michael Schmarck:
>> >> You're not shutting down the system in a clean way.
>> >
>> > You're not? I thought that's the purpose of the whole thing?
>>
>> It's more like pulling the plug, isn't it? At least none of
>> the shutdown scripts is run.  And if you don't run ALT + SysRq + U,
>> or if it just doesn't work (like hangs at some (remote) fs),
> 
> But nobody proposed _not_ to run ALT + SysRq + U,

True, but if things come to worse, you've got to do a ALT+SysRq+B
or +O, even before +U completely returned. As said, it can happen,
that U(nmount) doesn't work - and then you'd need to shutdown
anyway.

> 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).

>> filesystems aren't even unmounted and thus dirty and thus need
>> a fsck run on next boot.
> 
> XFS to the rescue :-)

Yep. Well, to be honest, I haven't had a fs die on me, because
of a Alt+SysRq+B.

Michael Schmarck
-- 
Inspiration without perspiration is usually sterile.


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



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [gentoo-user]  Re: Emergency shutdown, how to?
  2008-04-02 17:40                   ` [gentoo-user] " Michael Schmarck
@ 2008-04-02 17:48                     ` Neil Bothwick
  2008-04-03  4:51                       ` [gentoo-user] " Michael Schmarck
  2008-04-04 21:05                       ` [gentoo-user] " Mark Knecht
  0 siblings, 2 replies; 54+ messages in thread
From: Neil Bothwick @ 2008-04-02 17:48 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 614 bytes --]

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. 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.


-- 
Neil Bothwick

Weird enough for government work.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [gentoo-user] Emergency shutdown, how to?
  2008-04-02 17:28             ` Volker Armin Hemmann
@ 2008-04-02 19:19               ` Dale
  2008-04-02 19:57                 ` Mark Knecht
                                   ` (3 more replies)
  0 siblings, 4 replies; 54+ messages in thread
From: Dale @ 2008-04-02 19:19 UTC (permalink / raw
  To: gentoo-user

Volker Armin Hemmann wrote:
> On Mittwoch, 2. April 2008, Steven Lembark wrote:
>   
>> Liviu Andronic wrote:
>>  > On Fri, Mar 28, 2008 at 10:07 AM, Dale <dalek1967@bellsouth.net> wrote:
>>  >>> By the way the safest and recommended command, although a bit longish
>>  >>> should be ALT+SysRq(or print)+S(ync)+U(mount)+B(Reboot).
>>  >>
>>  >>  Since I wanted to shutdown instead of reboot, it would be ALT + SysRq
>>  >> + S + U + O then correct?
>>  >
>>  > Are there any potential harms to the hardware / system in case one
>>  > tends to abuse (i.e. use more often than necessary) of this command?
>>  > It's so often so tempting to shut down your system fast.
>>
>> Short of a serious emergency (e.g., UPS with
>> 30-sec lag and no input power) stick with
>> 'shutdown -fh now'. The main problem is that
>> you bypass the stop phase of all the app's
>> started up via init.d; very little short of
>> just hitting the reset switch or yanking the
>> power.
>>     
>
> if you do it the right way, start with 'e' and 'i', all apps are cleanly 
> terminated/killed. So if an app does not quit cleanly, it is broken.
>
> The correct sequence is: e,i,u,b/o and it is absolutly save.
>   


Folks, keep in mind why I asked this question in the first place.  My 
power supply was frying and I needed a VERY fast shutdown.  This was not 
asked as a fast way to shutdown just because we are impatient or 
something.  This was for the event of a serious emergency where I needed 
a shutdown in just a very few seconds not a minute or two.  Some of my 
services take a while to stop, foldingathome being the longest one.

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.  :'(

Dale

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



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [gentoo-user] Emergency shutdown, how to?
  2008-04-02 19:19               ` Dale
@ 2008-04-02 19:57                 ` Mark Knecht
  2008-04-02 21:42                   ` Neil Bothwick
  2008-04-02 19:59                 ` Volker Armin Hemmann
                                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 54+ messages in thread
From: Mark Knecht @ 2008-04-02 19:57 UTC (permalink / raw
  To: gentoo-user

On Wed, Apr 2, 2008 at 12:19 PM, Dale <dalek1967@bellsouth.net> wrote:
>
> Volker Armin Hemmann wrote:
>
> > On Mittwoch, 2. April 2008, Steven Lembark wrote:
> >
> >
> > > Liviu Andronic wrote:
> > >  > On Fri, Mar 28, 2008 at 10:07 AM, Dale <dalek1967@bellsouth.net>
> wrote:
> > >  >>> By the way the safest and recommended command, although a bit
> longish
> > >  >>> should be ALT+SysRq(or print)+S(ync)+U(mount)+B(Reboot).
> > >  >>
> > >  >>  Since I wanted to shutdown instead of reboot, it would be ALT +
> SysRq
> > >  >> + S + U + O then correct?
> > >  >
> > >  > Are there any potential harms to the hardware / system in case one
> > >  > tends to abuse (i.e. use more often than necessary) of this command?
> > >  > It's so often so tempting to shut down your system fast.
> > >
> > > Short of a serious emergency (e.g., UPS with
> > > 30-sec lag and no input power) stick with
> > > 'shutdown -fh now'. The main problem is that
> > > you bypass the stop phase of all the app's
> > > started up via init.d; very little short of
> > > just hitting the reset switch or yanking the
> > > power.
> > >
> > >
> >
> > if you do it the right way, start with 'e' and 'i', all apps are cleanly
> terminated/killed. So if an app does not quit cleanly, it is broken.
> >
> > The correct sequence is: e,i,u,b/o and it is absolutly save.
> >
> >
>
>
>  Folks, keep in mind why I asked this question in the first place.  My power
> supply was frying and I needed a VERY fast shutdown.  This was not asked as
> a fast way to shutdown just because we are impatient or something.  This was
> for the event of a serious emergency where I needed a shutdown in just a
> very few seconds not a minute or two.  Some of my services take a while to
> stop, foldingathome being the longest one.
>
>  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.  :'(
>
>  Dale
>
>  :-)  :-)
>

Understood. I think it sort of morphed into something more general,
like what to do when the rest of us run into the occasional problem we
all run into. Yesterday our MythTV backend server crashed 4 times. It
hung completely killing X, etc. and I was in need of a good way to
bring the machine down. I found this topic both timely and helpful, at
least for future problems.

Cheers,
Mark
-- 
gentoo-user@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [gentoo-user] Emergency shutdown, how to?
  2008-04-02 19:19               ` Dale
  2008-04-02 19:57                 ` Mark Knecht
@ 2008-04-02 19:59                 ` Volker Armin Hemmann
  2008-04-02 21:43                 ` Neil Bothwick
  2008-04-03 16:10                 ` Steven Lembark
  3 siblings, 0 replies; 54+ messages in thread
From: Volker Armin Hemmann @ 2008-04-02 19:59 UTC (permalink / raw
  To: gentoo-user

On Mittwoch, 2. April 2008, Dale wrote:
> Volker Armin Hemmann wrote:
> > On Mittwoch, 2. April 2008, Steven Lembark wrote:
> >> Liviu Andronic wrote:
> >>  > On Fri, Mar 28, 2008 at 10:07 AM, Dale <dalek1967@bellsouth.net> 
wrote:
> >>  >>> By the way the safest and recommended command, although a bit
> >>  >>> longish should be ALT+SysRq(or print)+S(ync)+U(mount)+B(Reboot).
> >>  >>
> >>  >>  Since I wanted to shutdown instead of reboot, it would be ALT +
> >>  >> SysRq + S + U + O then correct?
> >>  >
> >>  > Are there any potential harms to the hardware / system in case one
> >>  > tends to abuse (i.e. use more often than necessary) of this command?
> >>  > It's so often so tempting to shut down your system fast.
> >>
> >> Short of a serious emergency (e.g., UPS with
> >> 30-sec lag and no input power) stick with
> >> 'shutdown -fh now'. The main problem is that
> >> you bypass the stop phase of all the app's
> >> started up via init.d; very little short of
> >> just hitting the reset switch or yanking the
> >> power.
> >
> > if you do it the right way, start with 'e' and 'i', all apps are cleanly
> > terminated/killed. So if an app does not quit cleanly, it is broken.
> >
> > The correct sequence is: e,i,u,b/o and it is absolutly save.
>
> Folks, keep in mind why I asked this question in the first place.  My
> power supply was frying and I needed a VERY fast shutdown.  This was not
> asked as a fast way to shutdown just because we are impatient or
> something.  This was for the event of a serious emergency where I needed
> a shutdown in just a very few seconds not a minute or two.  Some of my
> services take a while to stop, foldingathome being the longest one.
>
> 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.  :'(
>
> Dale
>
> :-)  :-)

even in an emergency, e,i,u,b/o is the right thing to do. Just don't wait 
after the e and follow it directly by the i.
-- 
gentoo-user@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [gentoo-user]  Emergency shutdown, how to?
  2008-04-02 15:18                   ` Neil Bothwick
@ 2008-04-02 20:58                     ` darren kirby
  2008-04-02 22:24                       ` Neil Bothwick
  0 siblings, 1 reply; 54+ messages in thread
From: darren kirby @ 2008-04-02 20:58 UTC (permalink / raw
  To: gentoo-user

quoth the Neil Bothwick:
> On Wed, 2 Apr 2008 16:28:29 +0200, Dirk Heinrichs wrote:
> > But nobody proposed _not_ to run ALT + SysRq + U, Neil even proposed
> > ALT + SysRq + EISUB, to be sure everything is killed, sync'd and
> > unmounted.
>
> Just don't try to do E or I over an SSH connection. It kills the SSH
> daemon and you can't reboot the box. You can guess how I learned that
> one :(

Ha. Hopefully the machine wasn't too far away physically.

-d
-- 
darren kirby :: Part of the problem since 1976 :: http://badcomputer.org
"...the number of UNIX installations has grown to 10, with more expected..."
- Dennis Ritchie and Ken Thompson, June 1972
-- 
gentoo-user@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [gentoo-user] Emergency shutdown, how to?
  2008-04-02 19:57                 ` Mark Knecht
@ 2008-04-02 21:42                   ` Neil Bothwick
  0 siblings, 0 replies; 54+ messages in thread
From: Neil Bothwick @ 2008-04-02 21:42 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 444 bytes --]

On Wed, 2 Apr 2008 12:57:21 -0700, Mark Knecht wrote:

> Yesterday our MythTV backend server crashed 4 times. It
> hung completely killing X, etc. and I was in need of a good way to
> bring the machine down.

You have X and a keyboard on your MythTV backend? There's no way I could
shut mine down quickly, first I have to get the ladder to get into the
loft...


-- 
Neil Bothwick

Stop tagline theft! Copyright your tagline (c)

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [gentoo-user] Emergency shutdown, how to?
  2008-04-02 19:19               ` Dale
  2008-04-02 19:57                 ` Mark Knecht
  2008-04-02 19:59                 ` Volker Armin Hemmann
@ 2008-04-02 21:43                 ` Neil Bothwick
  2008-04-02 21:56                   ` Dale
  2008-04-03 16:10                 ` Steven Lembark
  3 siblings, 1 reply; 54+ messages in thread
From: Neil Bothwick @ 2008-04-02 21:43 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 398 bytes --]

On Wed, 02 Apr 2008 14:19:36 -0500, Dale wrote:

> Folks, keep in mind why I asked this question in the first place.  My 
> power supply was frying and I needed a VERY fast shutdown.

I'd shutdown and stay shutdown until I could replace the PSU. PSUs are
cheap, the components a dying one can take with it are not :(


-- 
Neil Bothwick

What is a "free" gift ? Aren't all gifts free?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [gentoo-user] Emergency shutdown, how to?
  2008-04-02 21:43                 ` Neil Bothwick
@ 2008-04-02 21:56                   ` Dale
  2008-04-03  2:35                     ` Hal Martin
  0 siblings, 1 reply; 54+ messages in thread
From: Dale @ 2008-04-02 21:56 UTC (permalink / raw
  To: gentoo-user

Neil Bothwick wrote:
> On Wed, 02 Apr 2008 14:19:36 -0500, Dale wrote:
>
>   
>> Folks, keep in mind why I asked this question in the first place.  My 
>> power supply was frying and I needed a VERY fast shutdown.
>>     
>
> I'd shutdown and stay shutdown until I could replace the PSU. PSUs are
> cheap, the components a dying one can take with it are not :(
>
>
>   

Well, the P/S went out right when it was unmounting at the very end of 
the shutdown process.  I had one file system that it had to replay a few 
things when I rebooted.  It was a close call since the file systems that 
wasn't unmounted was not a critical one.

I did replace the P/S with a new one tho.  After getting the rubber band 
off the fan, I did check to see if it would boot up but it just sat 
there.  I took it back apart and one of the transistors had a burnt 
spot, actually, it was a diode.  Since when those things burn out they 
are basically not repairable, I just got a new one locally.  I plan to 
get a permanent replacement from newegg soon.  The P/S I have right now 
is a A-Open or something.  It was all they had.  I did notice that the 5 
volt rail is higher than the other P/S's I have had before tho.  This 
one is at 4.97 volts where it is usually 4.91 or something.

You are right about burning out other components tho.  I have had two 
P/S's to burn out in this one rig.  So far, nothing else hurt.  I have 
some good luck I guess.

Dale

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



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [gentoo-user]  Emergency shutdown, how to?
  2008-04-02 20:58                     ` darren kirby
@ 2008-04-02 22:24                       ` Neil Bothwick
  0 siblings, 0 replies; 54+ messages in thread
From: Neil Bothwick @ 2008-04-02 22:24 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 412 bytes --]

On Wed, 02 Apr 2008 14:58:22 -0600, darren kirby wrote:

> > Just don't try to do E or I over an SSH connection. It kills the SSH
> > daemon and you can't reboot the box. You can guess how I learned that
> > one :(  
> 
> Ha. Hopefully the machine wasn't too far away physically.

Yards, fortunately :)


-- 
Neil Bothwick

"Bother," said Pooh, as Christopher Robin shut the washing machine door.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [gentoo-user] Emergency shutdown, how to?
  2008-04-02 21:56                   ` Dale
@ 2008-04-03  2:35                     ` Hal Martin
  0 siblings, 0 replies; 54+ messages in thread
From: Hal Martin @ 2008-04-03  2:35 UTC (permalink / raw
  To: gentoo-user

Dale wrote:
> Neil Bothwick wrote:
>> On Wed, 02 Apr 2008 14:19:36 -0500, Dale wrote:
>>
>>  
>>> Folks, keep in mind why I asked this question in the first place. 
>>> My power supply was frying and I needed a VERY fast shutdown.
>>>     
>>
>> I'd shutdown and stay shutdown until I could replace the PSU. PSUs are
>> cheap, the components a dying one can take with it are not :(
>>
>>
>>   
>
> Well, the P/S went out right when it was unmounting at the very end of
> the shutdown process.  I had one file system that it had to replay a
> few things when I rebooted.  It was a close call since the file
> systems that wasn't unmounted was not a critical one.
I can no longer contain my curiosity. How did you know it was frying?
Smell, smoke? Normally, when something like that fails, it will fail too
quickly for you to do anything about it.
>
> I did replace the P/S with a new one tho.  After getting the rubber
> band off the fan, I did check to see if it would boot up but it just
> sat there.  I took it back apart and one of the transistors had a
> burnt spot, actually, it was a diode.  Since when those things burn
> out they are basically not repairable, I just got a new one locally. 
> I plan to get a permanent replacement from newegg soon.  The P/S I
> have right now is a A-Open or something.  It was all they had.  I did
> notice that the 5 volt rail is higher than the other P/S's I have had
> before tho.  This one is at 4.97 volts where it is usually 4.91 or
> something.
Ah yes, the old dead fan problem... that's why I keep a can of
compressed air near my desk, and if not that, a pair of full lungs. ;-)

A low quality PSU shouldn't be too bad, for the time being. However, I
wouldn't recommend running on one for longer than necessary. I've had
friends who trusted case PSUs a little too much, and paid the price.
>
> You are right about burning out other components tho.  I have had two
> P/S's to burn out in this one rig.  So far, nothing else hurt.  I have
> some good luck I guess.
Sounds like it. Hey, can I borrow some of that luck? You'll get it back
in *almost* mint condition.
>
> Dale
>
-Hal
> :-)  :-) 

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



^ permalink raw reply	[flat|nested] 54+ messages in thread

* [gentoo-user]  Re: Re: Emergency shutdown, how to?
  2008-04-02 17:48                     ` Neil Bothwick
@ 2008-04-03  4:51                       ` Michael Schmarck
  2008-04-03  8:41                         ` Neil Bothwick
  2008-04-04 21:05                       ` [gentoo-user] " Mark Knecht
  1 sibling, 1 reply; 54+ messages in thread
From: Michael Schmarck @ 2008-04-03  4:51 UTC (permalink / raw
  To: gentoo-user

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



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [gentoo-user]  Re: Re: Emergency shutdown, how to?
  2008-04-03  4:51                       ` [gentoo-user] " Michael Schmarck
@ 2008-04-03  8:41                         ` Neil Bothwick
  2008-04-03  8:56                           ` [gentoo-user] " Michael Schmarck
  0 siblings, 1 reply; 54+ messages in thread
From: Neil Bothwick @ 2008-04-03  8:41 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 639 bytes --]

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.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 54+ messages in thread

* [gentoo-user]  Re: Re: Re: Emergency shutdown, how to?
  2008-04-03  8:41                         ` Neil Bothwick
@ 2008-04-03  8:56                           ` Michael Schmarck
  2008-04-04  0:28                             ` Iain Buchanan
  0 siblings, 1 reply; 54+ messages in thread
From: Michael Schmarck @ 2008-04-03  8:56 UTC (permalink / raw
  To: gentoo-user

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



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [gentoo-user] Emergency shutdown, how to?
  2008-04-02 19:19               ` Dale
                                   ` (2 preceding siblings ...)
  2008-04-02 21:43                 ` Neil Bothwick
@ 2008-04-03 16:10                 ` Steven Lembark
  2008-04-03 18:15                   ` Dale
  2008-04-04  0:29                   ` Iain Buchanan
  3 siblings, 2 replies; 54+ messages in thread
From: Steven Lembark @ 2008-04-03 16:10 UTC (permalink / raw
  To: gentoo-user


 > 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



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [gentoo-user] Emergency shutdown, how to?
  2008-04-03 16:10                 ` Steven Lembark
@ 2008-04-03 18:15                   ` Dale
  2008-04-03 19:38                     ` Steven Lembark
  2008-04-04  0:29                   ` Iain Buchanan
  1 sibling, 1 reply; 54+ messages in thread
From: Dale @ 2008-04-03 18:15 UTC (permalink / raw
  To: gentoo-user

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



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [gentoo-user] Emergency shutdown, how to?
  2008-04-03 18:15                   ` Dale
@ 2008-04-03 19:38                     ` Steven Lembark
  2008-04-04  0:45                       ` Dale
  0 siblings, 1 reply; 54+ messages in thread
From: Steven Lembark @ 2008-04-03 19:38 UTC (permalink / raw
  To: gentoo-user


 > 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



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [gentoo-user]  Re: Re: Re: Emergency shutdown, how to?
  2008-04-03  8:56                           ` [gentoo-user] " Michael Schmarck
@ 2008-04-04  0:28                             ` Iain Buchanan
  0 siblings, 0 replies; 54+ messages in thread
From: Iain Buchanan @ 2008-04-04  0:28 UTC (permalink / raw
  To: gentoo-user

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



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [gentoo-user] Emergency shutdown, how to?
  2008-04-03 16:10                 ` Steven Lembark
  2008-04-03 18:15                   ` Dale
@ 2008-04-04  0:29                   ` Iain Buchanan
  2008-04-04  1:00                     ` Dale
  1 sibling, 1 reply; 54+ messages in thread
From: Iain Buchanan @ 2008-04-04  0:29 UTC (permalink / raw
  To: gentoo-user

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



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [gentoo-user] Emergency shutdown, how to?
  2008-04-03 19:38                     ` Steven Lembark
@ 2008-04-04  0:45                       ` Dale
  2008-04-04 17:04                         ` Steven Lembark
  0 siblings, 1 reply; 54+ messages in thread
From: Dale @ 2008-04-04  0:45 UTC (permalink / raw
  To: gentoo-user

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



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [gentoo-user] Emergency shutdown, how to?
  2008-04-04  0:29                   ` Iain Buchanan
@ 2008-04-04  1:00                     ` Dale
  2008-04-04 17:06                       ` Steven Lembark
  0 siblings, 1 reply; 54+ messages in thread
From: Dale @ 2008-04-04  1:00 UTC (permalink / raw
  To: gentoo-user

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



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [gentoo-user] Emergency shutdown, how to?
  2008-04-04  0:45                       ` Dale
@ 2008-04-04 17:04                         ` Steven Lembark
  2008-04-04 19:52                           ` Dale
  0 siblings, 1 reply; 54+ messages in thread
From: Steven Lembark @ 2008-04-04 17:04 UTC (permalink / raw
  To: gentoo-user

Dale wrote:
> 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

I have four FAH jobs running on my compute server. I
can "kill -TERM fah6" in about 0.70 sec here, they
start up again and just keep going. FAH is pretty
robust when it comes to restarts; again if you crash
the proc's then it won't be any worse than the outcome
of loosing power: FAH will have to pick up its pieces
and keep going. At least with "halt -f" you'll get
the kernel space cleaned up.

Halt will stop the O/S (see note from manpage, below).
In this case a 'halt -f' would get the system down
about as quickly as possible without just hitting
the reset button.

NOTES
       Under  older sysvinit releases , reboot and halt should never be
called
       directly. From release 2.74 on halt and reboot  invoke
shutdown(8)  if
       the system is not in runlevel 0 or 6. This means that if halt or
reboot
       cannot find out the current runlevel (for example,  when
/var/run/utmp
       hasn't been initialized correctly) shutdown will be called, which
might
       not be what you want.  Use the -f flag if you want to do a hard
halt or
       reboot.

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



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [gentoo-user] Emergency shutdown, how to?
  2008-04-04  1:00                     ` Dale
@ 2008-04-04 17:06                       ` Steven Lembark
  2008-04-07  6:42                         ` Dan Farrell
  0 siblings, 1 reply; 54+ messages in thread
From: Steven Lembark @ 2008-04-04 17:06 UTC (permalink / raw
  To: gentoo-user


>>> 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.

Pair of dual-PIII VA Linux machines, one compute
server with twin dual-core opterons. Main thing
that speeds up the AMD box is using 320MB scsi's
for near-term storage. They are hugely faster than
[S]ATA or IDE used on most equipment these days.

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



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [gentoo-user] Emergency shutdown, how to?
  2008-04-04 17:04                         ` Steven Lembark
@ 2008-04-04 19:52                           ` Dale
  2008-04-04 20:24                             ` Steven Lembark
  0 siblings, 1 reply; 54+ messages in thread
From: Dale @ 2008-04-04 19:52 UTC (permalink / raw
  To: gentoo-user

Steven Lembark wrote:
>
> I have four FAH jobs running on my compute server. I
> can "kill -TERM fah6" in about 0.70 sec here, they
> start up again and just keep going. FAH is pretty
> robust when it comes to restarts; again if you crash
> the proc's then it won't be any worse than the outcome
> of loosing power: FAH will have to pick up its pieces
> and keep going. At least with "halt -f" you'll get
> the kernel space cleaned up.
>
> Halt will stop the O/S (see note from manpage, below).
> In this case a 'halt -f' would get the system down
> about as quickly as possible without just hitting
> the reset button.
>
> NOTES
>        Under  older sysvinit releases , reboot and halt should never be
> called
>        directly. From release 2.74 on halt and reboot  invoke
> shutdown(8)  if
>        the system is not in runlevel 0 or 6. This means that if halt or
> reboot
>        cannot find out the current runlevel (for example,  when
> /var/run/utmp
>        hasn't been initialized correctly) shutdown will be called, which
> might
>        not be what you want.  Use the -f flag if you want to do a hard
> halt or
>        reboot.
>
>   

I see your point on stopping FAH.  Here, when I do a regular stop, it 
has a 17 second wait, can be 60 seconds depending on what it is doing at 
the time.  That is if it is called by /etc/init.d/zzfah stop.  I didn't 
have time to type in a lot of commands at the point my P/S was stinking 
my room up.  You are also correct that FAH is very robust.  It writes 
its restart point every 3 minutes on this rig so the most it will loose 
is about 3 minutes.  I have only lost data with FAH once.

I did test the halt -f command last night.  I must say, it was fast.  It 
was literally a few seconds, very few.  I did have one file system that 
was . . . well . . . a little upset.  I use reiserfs and after a fsck, 
everything was fine.  I also learned to add the -p option to that 
command.  The halt -f command  but did not power off my system.

I learned a lot with this ordeal.  One thing is that the P/S's 
protection circuit must have worked very well.  My mobo is doing just 
fine so no damage outside of the P/S itself.  I also learned that the 
halt -f -p command should be really fast if this happens again.

Keep those thoughts coming.

Dale

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



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [gentoo-user] Emergency shutdown, how to?
  2008-04-04 19:52                           ` Dale
@ 2008-04-04 20:24                             ` Steven Lembark
  0 siblings, 0 replies; 54+ messages in thread
From: Steven Lembark @ 2008-04-04 20:24 UTC (permalink / raw
  To: gentoo-user


> I learned a lot with this ordeal.  One thing is that the P/S's
> protection circuit must have worked very well.  My mobo is doing just
> fine so no damage outside of the P/S itself.  I also learned that the
> halt -f -p command should be really fast if this happens again.
>
> Keep those thoughts coming.

    poweroff -f;

NAME
       halt, reboot, poweroff - stop the system.

SYNOPSIS
       /sbin/halt [-n] [-w] [-d] [-f] [-i] [-p] [-h]
       /sbin/reboot [-n] [-w] [-d] [-f] [-i] [-k]
       /sbin/poweroff [-n] [-w] [-d] [-f] [-i] [-h]


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



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [gentoo-user] Re: Emergency shutdown, how to?
  2008-04-02 17:48                     ` Neil Bothwick
  2008-04-03  4:51                       ` [gentoo-user] " Michael Schmarck
@ 2008-04-04 21:05                       ` Mark Knecht
  2008-04-04 21:50                         ` Neil Bothwick
  2008-04-05 16:42                         ` Steven Lembark
  1 sibling, 2 replies; 54+ messages in thread
From: Mark Knecht @ 2008-04-04 21:05 UTC (permalink / raw
  To: gentoo-user

On Wed, Apr 2, 2008 at 10:48 AM, 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. 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.
>

I tried ALT + SysRq + EISUB today on my MythTV backend server which
has been crashing lately. Unfortunately it's crashing so badly that
even at the server's keyboard this didn't work.

I guess my weekend fate of building a new server is sealed...

Cheers,
Mark
-- 
gentoo-user@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [gentoo-user] Re: Emergency shutdown, how to?
  2008-04-04 21:05                       ` [gentoo-user] " Mark Knecht
@ 2008-04-04 21:50                         ` Neil Bothwick
  2008-04-04 22:14                           ` Mark Knecht
  2008-04-05 16:42                         ` Steven Lembark
  1 sibling, 1 reply; 54+ messages in thread
From: Neil Bothwick @ 2008-04-04 21:50 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 433 bytes --]

On Fri, 4 Apr 2008 14:05:42 -0700, Mark Knecht wrote:

> I tried ALT + SysRq + EISUB today on my MythTV backend server which
> has been crashing lately. Unfortunately it's crashing so badly that
> even at the server's keyboard this didn't work.

Do you have CONFIG_MAGIC_SYSRQ=y in your kernel config?


-- 
Neil Bothwick

A woman walked into a bar and asked the barman for a large double
entendre, so he gave her one.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [gentoo-user] Re: Emergency shutdown, how to?
  2008-04-04 21:50                         ` Neil Bothwick
@ 2008-04-04 22:14                           ` Mark Knecht
  0 siblings, 0 replies; 54+ messages in thread
From: Mark Knecht @ 2008-04-04 22:14 UTC (permalink / raw
  To: gentoo-user

On Fri, Apr 4, 2008 at 2:50 PM, Neil Bothwick <neil@digimed.co.uk> wrote:
> On Fri, 4 Apr 2008 14:05:42 -0700, Mark Knecht wrote:
>
>  > I tried ALT + SysRq + EISUB today on my MythTV backend server which
>  > has been crashing lately. Unfortunately it's crashing so badly that
>  > even at the server's keyboard this didn't work.
>
>  Do you have CONFIG_MAGIC_SYSRQ=y in your kernel config?
>
>
>  --
>  Neil Bothwick

No Neil, it turns out on that one machine is isn't set. Thanks. I'll
make sure it's set on the new server.

Cheers,
Mark
-- 
gentoo-user@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [gentoo-user] Re: Emergency shutdown, how to?
  2008-04-04 21:05                       ` [gentoo-user] " Mark Knecht
  2008-04-04 21:50                         ` Neil Bothwick
@ 2008-04-05 16:42                         ` Steven Lembark
  2008-04-07  1:07                           ` Iain Buchanan
  1 sibling, 1 reply; 54+ messages in thread
From: Steven Lembark @ 2008-04-05 16:42 UTC (permalink / raw
  To: gentoo-user


> I tried ALT + SysRq + EISUB today on my MythTV backend server which
> has been crashing lately. Unfortunately it's crashing so badly that
> even at the server's keyboard this didn't work.
>
> I guess my weekend fate of building a new server is sealed...

Have fun.

Check out motherboards with watchdog capability
and enable it in the kernel.

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



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [gentoo-user] Re: Emergency shutdown, how to?
  2008-04-05 16:42                         ` Steven Lembark
@ 2008-04-07  1:07                           ` Iain Buchanan
  2008-04-07 17:28                             ` Steven Lembark
  0 siblings, 1 reply; 54+ messages in thread
From: Iain Buchanan @ 2008-04-07  1:07 UTC (permalink / raw
  To: gentoo-user

On Sat, 2008-04-05 at 12:42 -0400, Steven Lembark wrote:
> > I tried ALT + SysRq + EISUB today on my MythTV backend server which
> > has been crashing lately. Unfortunately it's crashing so badly that
> > even at the server's keyboard this didn't work.
> >
> > I guess my weekend fate of building a new server is sealed...
> 
> Have fun.
> 
> Check out motherboards with watchdog capability
> and enable it in the kernel.

watchdogs are nice, and linux makes them ultra-easy to program, but of
course if your watchdog task dies, then the machine effectively hits the
reset button for you - no nice shutdown whatsoever!  (Which is what you
want in a hard lock-up, but not if your programming skills are the cause
of the problem :)

cya,
-- 
Iain Buchanan <iaindb at netspace dot net dot au>

Evil is that which one believes of others.  It is a sin to believe evil
of others, but it is seldom a mistake.
		-- H.L. Mencken

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



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [gentoo-user] Emergency shutdown, how to?
  2008-04-04 17:06                       ` Steven Lembark
@ 2008-04-07  6:42                         ` Dan Farrell
  2008-04-07 20:14                           ` Steven Lembark
  0 siblings, 1 reply; 54+ messages in thread
From: Dan Farrell @ 2008-04-07  6:42 UTC (permalink / raw
  To: gentoo-user

On Fri, 04 Apr 2008 13:06:04 -0400
Steven Lembark <lembark@wrkhors.com> wrote:

> Main thing
> that speeds up the AMD box is using 320MB scsi's
> for near-term storage. They are hugely faster than
> [S]ATA or IDE used on most equipment these days.

what R/W speeds can you expect?
-- 
gentoo-user@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [gentoo-user] Re: Emergency shutdown, how to?
  2008-04-07  1:07                           ` Iain Buchanan
@ 2008-04-07 17:28                             ` Steven Lembark
  2008-04-07 23:29                               ` Iain Buchanan
  0 siblings, 1 reply; 54+ messages in thread
From: Steven Lembark @ 2008-04-07 17:28 UTC (permalink / raw
  To: gentoo-user

Iain Buchanan wrote:
> On Sat, 2008-04-05 at 12:42 -0400, Steven Lembark wrote:
>>> I tried ALT + SysRq + EISUB today on my MythTV backend server which
>>> has been crashing lately. Unfortunately it's crashing so badly that
>>> even at the server's keyboard this didn't work.
>>>
>>> I guess my weekend fate of building a new server is sealed...
>> Have fun.
>>
>> Check out motherboards with watchdog capability
>> and enable it in the kernel.
>
> watchdogs are nice, and linux makes them ultra-easy to program, but of
> course if your watchdog task dies, then the machine effectively hits the
> reset button for you - no nice shutdown whatsoever!  (Which is what you
> want in a hard lock-up, but not if your programming skills are the cause
> of the problem :)

- Have the system turn off the watchdog if the file is
  closed.

- After that just open it and poke a bit out now and
  then.

- Make a point of closing the file on exit.

    #!/usr/bin/perl

    use strict;

    open my $fh, '<', '/path/to/watchdog/file'
    or die "Failed opening watchdog file: $!";

    # watchdog is now watching...

    select $fh;

    for(;;)
    {
        print "\n";

        sleep 1;    # watchdog timeout / 2
    }

    my $graceful_exit
    = sub
    {
        close $fh;

        exit 0
    };

    for sig in ( qw( TERM QUIT INT __DIE__ ) )
    {
        $SIG{ $sig }    = $graceful_exit;
    }

    for sig in ( qw( HUP ) )
    {
        $SIG{ $SIG }    = 'IGNORE';
    }

    __END__

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



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [gentoo-user] Emergency shutdown, how to?
  2008-04-07  6:42                         ` Dan Farrell
@ 2008-04-07 20:14                           ` Steven Lembark
  0 siblings, 0 replies; 54+ messages in thread
From: Steven Lembark @ 2008-04-07 20:14 UTC (permalink / raw
  To: gentoo-user


>> Main thing
>> that speeds up the AMD box is using 320MB scsi's
>> for near-term storage. They are hugely faster than
>> [S]ATA or IDE used on most equipment these days.
>
> what R/W speeds can you expect?

Operations on SCSI run 2-3 times faster for large-ish
file transfers (say 1MB or more). For example GIMP
runs without noticeable pauses on most operations with
my 2GHz opteron using the SCSI's as storage and scratch
space; on the same machine with the SATA's it bogs down
to the point of annoyance, with things like saves taking
seconds to complete. The only difference being which
drives I'm using for tiles and data.

Bonnie gets upset validating the scsi space on this
box since it has 8GB of core and I don't have 16GB
free on the device so I can't give you any specific
numbers.


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



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [gentoo-user] Re: Emergency shutdown, how to?
  2008-04-07 17:28                             ` Steven Lembark
@ 2008-04-07 23:29                               ` Iain Buchanan
  2008-04-08 18:19                                 ` Steven Lembark
  0 siblings, 1 reply; 54+ messages in thread
From: Iain Buchanan @ 2008-04-07 23:29 UTC (permalink / raw
  To: gentoo-user

On Mon, 2008-04-07 at 13:28 -0400, Steven Lembark wrote:
> Iain Buchanan wrote:

> > watchdogs are nice, and linux makes them ultra-easy to program, but of
> > course if your watchdog task dies, then the machine effectively hits the
> > reset button for you - no nice shutdown whatsoever!  (Which is what you
> > want in a hard lock-up, but not if your programming skills are the cause
> > of the problem :)
> 
> - Have the system turn off the watchdog if the file is
>   closed.

maybe, maybe not :)  I personally like setting CONFIG_WATCHDOG_NOWAYOUT
on systems with hardware watchdogs, especially remote unattended
systems.  Usually your watchdog task never dies on such a system, and
when it does (be it from a nice kill or not) you want the watchdog to
fire.  However if this is a semi-used system (you ssh or log-in to it in
any way to do stuff) you may not want this.

> - After that just open it and poke a bit out now and
>   then.
> 
> - Make a point of closing the file on exit.
> 
>     #!/usr/bin/perl
> 
>     use strict;
> 
>     open my $fh, '<', '/path/to/watchdog/file'

it's usually /dev/watchdog if you're using the linux kernel interface.

I agree that your script is nice and simple, and hence less prone to
errors.  I coded mine in c++ because I use it not only for a machine
type watchdog, but also a task based watchdog that reboots the machine
based on certain tasks living or not.  Each task has to register with
the watchdog server and continually tell the server they're alive, or
reboot!  But that's a story for another thread...
-- 
Iain Buchanan <iaindb at netspace dot net dot au>

Linux - Where do you want to fly today?
	-- Unknown source

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



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [gentoo-user] Re: Emergency shutdown, how to?
  2008-04-07 23:29                               ` Iain Buchanan
@ 2008-04-08 18:19                                 ` Steven Lembark
  0 siblings, 0 replies; 54+ messages in thread
From: Steven Lembark @ 2008-04-08 18:19 UTC (permalink / raw
  To: gentoo-user


> I agree that your script is nice and simple, and hence less prone to
> errors.  I coded mine in c++ because I use it not only for a machine
> type watchdog, but also a task based watchdog that reboots the machine
> based on certain tasks living or not.  Each task has to register with
> the watchdog server and continually tell the server they're alive, or
> reboot!  But that's a story for another thread...

    #!/path/to/perl

    use strict;

    use Sys::Syslog;

    open my $fh, '>', '/dev/watchdog'
    or die "/dev/watchdog: $!";

    # if any of these go away we need to notice it.
    # ok... you'll notice the first one anyway.

    my @watchz
    = qw
    (
        init
        ntpd
        apache
        /opt/sybase/ASE-12_5/bin/dataserver
    );

    # wd timeout / 2, or 1 for minimum sleep
    # (avoid usleep: too much overhead).

    my $cycle   = 15;

    # get the syslog handle

    openlog blah blah blah
    or die 'Et tu, syslog?';

    CYCLE:
    for(;;)
    {
        sleep ( $cycle - ( time % $cycle ) );

        # split and args vary by O/S, this works on linux.

        my @procz   = map { split /\s+/, $_, 6 )[5] } qx( ps a );

        my %chechz  = ();

        @chechz{ @watchz }  = ();

        delete @chechz{ @procz };

        if( %chechz )
        {
            # oops, current proc's don't include the
            # list of processes being watched.
            #
            # this can happen twice in a w/d interval
            # before the system goes down.

            my $nastygram
            = join "\t", 'Missing proc's:', join "\t", keys %chechz

            syslog LOG_CRIT | LOG_FOO, $nastygram;

            next CYCLE

            # alternative here is to close $fh here and
            # bounce the system immediately, the
            # approach of looping allows an
            # intentional restart of the service
            # (in less than 1 w/d cycle) w/o bouncing the box.
        }

        # if the proc check got this far then the w/d
        # file gets poked and we live for another loop.

        print $wd "\n";
    }

    # this isn't a module

    0

    __END__

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



^ permalink raw reply	[flat|nested] 54+ messages in thread

end of thread, other threads:[~2008-04-08 18:27 UTC | newest]

Thread overview: 54+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-28  7:33 [gentoo-user] Emergency shutdown, how to? Dale
2008-03-28  7:41 ` Daniel Pielmeier
2008-03-28  7:46   ` Dirk Heinrichs
2008-03-28  7:51     ` Daniel Pielmeier
2008-03-28  8:07       ` Dale
2008-03-28  8:11         ` Dirk Heinrichs
2008-03-28 10:12           ` Michal 'vorner' Vaner
2008-04-02 13:36         ` Liviu Andronic
2008-04-02 13:44           ` [gentoo-user] " Michael Schmarck
2008-04-02 13:49             ` Dirk Heinrichs
2008-04-02 14:19               ` [gentoo-user] " Michael Schmarck
2008-04-02 14:28                 ` [gentoo-user] " Dirk Heinrichs
2008-04-02 14:41                   ` Mark Knecht
2008-04-02 15:18                   ` Neil Bothwick
2008-04-02 20:58                     ` darren kirby
2008-04-02 22:24                       ` Neil Bothwick
2008-04-02 17:40                   ` [gentoo-user] " Michael Schmarck
2008-04-02 17:48                     ` Neil Bothwick
2008-04-03  4:51                       ` [gentoo-user] " Michael Schmarck
2008-04-03  8:41                         ` Neil Bothwick
2008-04-03  8:56                           ` [gentoo-user] " Michael Schmarck
2008-04-04  0:28                             ` Iain Buchanan
2008-04-04 21:05                       ` [gentoo-user] " Mark Knecht
2008-04-04 21:50                         ` Neil Bothwick
2008-04-04 22:14                           ` Mark Knecht
2008-04-05 16:42                         ` Steven Lembark
2008-04-07  1:07                           ` Iain Buchanan
2008-04-07 17:28                             ` Steven Lembark
2008-04-07 23:29                               ` Iain Buchanan
2008-04-08 18:19                                 ` Steven Lembark
2008-04-02 15:50           ` [gentoo-user] " Steven Lembark
2008-04-02 17:28             ` Volker Armin Hemmann
2008-04-02 19:19               ` Dale
2008-04-02 19:57                 ` Mark Knecht
2008-04-02 21:42                   ` Neil Bothwick
2008-04-02 19:59                 ` Volker Armin Hemmann
2008-04-02 21:43                 ` Neil Bothwick
2008-04-02 21:56                   ` Dale
2008-04-03  2:35                     ` Hal Martin
2008-04-03 16:10                 ` Steven Lembark
2008-04-03 18:15                   ` Dale
2008-04-03 19:38                     ` Steven Lembark
2008-04-04  0:45                       ` Dale
2008-04-04 17:04                         ` Steven Lembark
2008-04-04 19:52                           ` Dale
2008-04-04 20:24                             ` Steven Lembark
2008-04-04  0:29                   ` Iain Buchanan
2008-04-04  1:00                     ` Dale
2008-04-04 17:06                       ` Steven Lembark
2008-04-07  6:42                         ` Dan Farrell
2008-04-07 20:14                           ` Steven Lembark
2008-03-28  8:29       ` Neil Bothwick
2008-03-28 11:09         ` Dale
2008-03-28  7:42 ` Dirk Heinrichs

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox