From owner-freebsd-questions@freebsd.org Thu Jan 28 08:24:45 2016 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8E7EA7136D for ; Thu, 28 Jan 2016 08:24:45 +0000 (UTC) (envelope-from freebsd@qeng-ho.org) Received: from outbound-queue-2.mail.thdo.gradwell.net (outbound-queue-2.mail.thdo.gradwell.net [212.11.70.35]) by mx1.freebsd.org (Postfix) with ESMTP id 82FD31A0D for ; Thu, 28 Jan 2016 08:24:45 +0000 (UTC) (envelope-from freebsd@qeng-ho.org) Received: from outbound-edge-1.mail.thdo.gradwell.net (bonnie.gradwell.net [212.11.70.2]) by outbound-queue-2.mail.thdo.gradwell.net (Postfix) with ESMTP id EF11855342; Thu, 28 Jan 2016 08:24:37 +0000 (GMT) Received: from relay.gradwell.com (HELO arthur.home.qeng-ho.org) (212.11.70.4) (smtp-auth username arthur@pop3.qeng-ho.org, mechanism plain) by outbound-edge-1.mail.thdo.gradwell.net (qpsmtpd/0.83) with ESMTPA; Thu, 28 Jan 2016 08:24:37 +0000 Subject: Re: Log power button To: Andrea Venturoli , freebsd-questions@freebsd.org References: <56A9129A.5050707@netfence.it> From: Arthur Chance Message-ID: <56A9D043.60508@qeng-ho.org> Date: Thu, 28 Jan 2016 08:24:35 +0000 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <56A9129A.5050707@netfence.it> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Gradwell-MongoId: 56a9d045.1cb4-62d3-1 X-Gradwell-Auth-Method: mailbox X-Gradwell-Auth-Credentials: arthur@pop3.qeng-ho.org X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jan 2016 08:24:45 -0000 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. -- Moore's Law of Mad Science: Every eighteen months, the minimum IQ necessary to destroy the world drops by one point.