From owner-freebsd-questions@freebsd.org Thu Jan 28 16:32:19 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 ED949A71393 for ; Thu, 28 Jan 2016 16:32:19 +0000 (UTC) (envelope-from freebsd-questions@m.gmane.org) Received: from plane.gmane.org (plane.gmane.org [80.91.229.3]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B2D5B1944 for ; Thu, 28 Jan 2016 16:32:19 +0000 (UTC) (envelope-from freebsd-questions@m.gmane.org) Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1aOpUP-0005Fu-Pj for freebsd-questions@freebsd.org; Thu, 28 Jan 2016 17:32:09 +0100 Received: from pool-72-66-1-32.washdc.fios.verizon.net ([72.66.1.32]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 28 Jan 2016 17:32:09 +0100 Received: from nightrecon by pool-72-66-1-32.washdc.fios.verizon.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 28 Jan 2016 17:32:09 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-questions@freebsd.org From: Michael Powell Subject: Re: Log power button Date: Thu, 28 Jan 2016 11:31:07 -0500 Lines: 42 Message-ID: References: <56A9129A.5050707@netfence.it> <56A9D043.60508@qeng-ho.org> Reply-To: nightrecon@hotmail.com Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: pool-72-66-1-32.washdc.fios.verizon.net 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 16:32:20 -0000 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