Date: Thu, 28 Jan 2016 11:31:07 -0500 From: Michael Powell <nightrecon@hotmail.com> To: freebsd-questions@freebsd.org Subject: Re: Log power button Message-ID: <n8dfq2$45v$1@ger.gmane.org> References: <56A9129A.5050707@netfence.it> <56A9D043.60508@qeng-ho.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Arthur Chance wrote: > On 27/01/2016 18:55, 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. >> >> 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. >> >> Is there any way to enable this? >> Maybe I'm dumb, but I looked for this and found nothing. > > It's not an area I'm that familiar with so double check this, but take a > look towards the end of /etc/devd.conf, where there's a comment about > ACPI notify handlers. There's a "Button" subsystem related to power and > sleep buttons. You probably want a devd rule that looks something like > > notify 0 { > match "system" "ACPI"; > match "subsystem" "Button"; > match "notify" "0"; > action "logger -p daemon.alert Power button pressed"; > } > > I can't guarantee that will work, I've never tried it, but it's a place > to start. > Also, in many BIOS of today there is a place to set what the ACPI action will be, ala: power off immediate upon press vs power off after press and hold 4 seconds is very common. -Mike
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?n8dfq2$45v$1>