Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Jan 2016 20:04:20 +0100
From:      Polytropon <freebsd@edvax.de>
To:        Andrea Venturoli <ml@netfence.it>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Log power button
Message-ID:  <20160127200420.f14b7a9a.freebsd@edvax.de>
In-Reply-To: <56A9129A.5050707@netfence.it>
References:  <56A9129A.5050707@netfence.it>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 27 Jan 2016 19:55:22 +0100, Andrea Venturoli wrote:
> Hello.
> 
> A server of mine (10.1) is "spontaneusly" rebooting.
> This is not a power failure/panic/crash/whatever, since it properly 
> shuts down.
> 
> I suspect someone is pushing the power button, but I have no physical 
> way to check. Problem is, this is not reported in the logs.

There are two things that the power button can do:

(a) short press: The OS will take the required action (shut down);

(b) long press: The computer will be forced to power off (no OS shutdown,
    no OS action) - equivalent to ripping out the power cord.

You can work with (a), and it will cause a log message. Case (b)
won't log anything as the system is _forced_ off.



> I vaguely remember older FreeBSD versions did this once, but I might be 
> wrong; I cannot check on this box (100km away), but I tried on another 
> one and, to my surprise, the fact that I pressed the power button was 
> NOT logged.

Older FreeBSD versions that utilized APM could have a custom action
when pressing the power button as in case (a) mentioned above. The
corresponding file was /etc/apmd.conf. Today ACPI is being used for
controlling what happens when the button is pressed.



> Is there any way to enable this?

I'm not sure APM can be re-enabled, it's probably not present "in
hardware" anymore...



> Maybe I'm dumb, but I looked for this and found nothing.

No, it just doesn't really exist anymore, no matter how hard you look. :-)



-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20160127200420.f14b7a9a.freebsd>