You are not logged in.

#1 2014-12-16 17:34:14

sickpuppy
Member
Registered: 2014-09-30
Posts: 4

How do I shutdown automatically when a kernel panic occurs?

I have a laptop, when the kernel panics it sits there with the screen on until the battery dies.  I would rather it just shut off.  I found some scattered info on the web about automatically rebooting, but since this is a laptop and not a server, it makes more sense for it to just stay off.

Offline

#2 2014-12-16 19:45:50

ANOKNUSA
Member
Registered: 2010-10-22
Posts: 2,141

Re: How do I shutdown automatically when a kernel panic occurs?

I have a laptop, when the kernel panics it sits there with the screen on until the battery dies.  I would rather it just shut off.

I pretty sure I'm feeding a troll, but just in case, here ya go.

Offline

#3 2014-12-16 19:56:33

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,742

Re: How do I shutdown automatically when a kernel panic occurs?

Anoknusa,
I am not sure that answers the mail.   If I understand the question, he wants the laptop to shut itself off in response to a kernel panic.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#4 2014-12-16 19:56:38

pypi
Wiki Maintainer
Registered: 2014-04-22
Posts: 250

Re: How do I shutdown automatically when a kernel panic occurs?

Well, rebooting is easy:

Take a look at the Arch Wiki article on kernel parameters.
And the kernel documentation on the subject, specifically for 'panic'.

Kernel docs wrote:

panic=        [KNL] Kernel behaviour on panic: delay <timeout>
            timeout > 0: seconds before rebooting
            timeout = 0: wait forever
            timeout < 0: reboot immediately
            Format: <timeout>

Presumably that was what your research found...

I'm not exactly sure, but I suspect that the way forward would be to create a script that detected if the last boot was a reboot due to a panic, and shut the laptop down after that?

How, I'm not sure. My limited google search didn't find anything either...

Last edited by pypi (2014-12-16 19:57:53)

Offline

#5 2014-12-16 20:01:05

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,742

Re: How do I shutdown automatically when a kernel panic occurs?

You might also try this

I've no idea if it work with our current configuration and I have no way to check it right now.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#6 2014-12-16 21:49:31

ANOKNUSA
Member
Registered: 2010-10-22
Posts: 2,141

Re: How do I shutdown automatically when a kernel panic occurs?

ewaller wrote:

Anoknusa,
I am not sure that answers the mail.   If I understand the question, he wants the laptop to shut itself off in response to a kernel panic.

That's what I gathered, yes. There were just two things that confounded me:

1) A kernel panic is the sort of thing one deals with immediately. If you're getting them all the time then you're doing something wrong, and if you're ignoring them and allowing the machine to run down its battery for who knows how long afterward you can't really be that interested in a solution.

2) The OP obviously has physical access to the machine. It doesn't turn itself on, it needs to be plugged in sometime to charge the battery, and needs to be unplugged if the battery is to drain down.

Hence my suspecting a troll. I could be totally wrong, and if so I offer my apologies and accept a kick in the shins. wink More information on the situation would be helpful.

Offline

Board footer

Powered by FluxBB