From owner-freebsd-stable@FreeBSD.ORG Sat Apr 18 03:11:43 2009 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 345211065672 for ; Sat, 18 Apr 2009 03:11:43 +0000 (UTC) (envelope-from sclark46@earthlink.net) Received: from elasmtp-mealy.atl.sa.earthlink.net (elasmtp-mealy.atl.sa.earthlink.net [209.86.89.69]) by mx1.freebsd.org (Postfix) with ESMTP id D32E68FC1C for ; Sat, 18 Apr 2009 03:11:42 +0000 (UTC) (envelope-from sclark46@earthlink.net) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=dk20050327; d=earthlink.net; b=Ilw8NVK9OUHWAxdoOB1746NLklhWd6VzlLgNGHL0HoZ2QI9bhcukb/5Fjm6gDql+; h=Received:Message-ID:Date:From:Reply-To:User-Agent:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding:X-ELNK-Trace:X-Originating-IP; Received: from [208.118.36.249] (helo=joker.seclark.com) by elasmtp-mealy.atl.sa.earthlink.net with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.67) (envelope-from ) id 1Lv0xj-0004Rz-Kj; Fri, 17 Apr 2009 23:11:27 -0400 Message-ID: <49E944DE.7080409@earthlink.net> Date: Fri, 17 Apr 2009 23:11:26 -0400 From: Stephen Clark User-Agent: Thunderbird 2.0.0.21 (X11/20090320) MIME-Version: 1.0 To: Nate Lawson References: <49DE1F8B.2080400@earthlink.net> <49DE2E6D.5050001@icyb.net.ua> <49DE596E.2050406@earthlink.net> <49DEFF53.1040306@icyb.net.ua> <49DF7A1C.90009@root.org> <20090418043432.O34434@sola.nimnet.asn.au> <49E8D824.1000001@root.org> In-Reply-To: <49E8D824.1000001@root.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-ELNK-Trace: a437fbc6971e80f61aa676d7e74259b7b3291a7d08dfec79b7c7ddddeebed1cd13a7956d82381bf5350badd9bab72f9c350badd9bab72f9c350badd9bab72f9c X-Originating-IP: 208.118.36.249 Cc: freebsd-acpi@freebsd.org, freebsd-stable@freebsd.org, Ian Smith , Andriy Gapon Subject: Re: 6.x acpi powerbutton X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: sclark46@earthlink.net List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Apr 2009 03:11:43 -0000 Nate Lawson wrote: > Ian Smith wrote: >> On Fri, 10 Apr 2009, Nate Lawson wrote: >> > Andriy Gapon wrote: >> > > on 09/04/2009 23:24 Stephen Clark said the following: >> > >> Is there a reason it doesn't send and event like Linux that can be acted >> > >> upon by user space other >> > >> than signaling init? I like to have a message written in >> > >> /var/log/messages that someone pressed >> > >> the powerbutton. >> > > >> > > I think that for all suspend states except S5 userland is notified via >> > > devd mechanism and potentially can veto the suspend. S5 (soft-off) is >> > > coded to start shutdown immediately. You can try to hack on >> > > acpi_ReqSleepState in sys/dev/acpica/acpi.c. >> > > >> > > I am not sure what is the reason for this special behavior of S5. But I >> > > like it, because it sometimes allows me to perform semi-clean shutdown >> > > when X goes crazy. But I also see when it could be useful to have S5 >> > > request go through userland. So this could be configurable. >> > >> > The reason for userland getting into the loop in the first place was to >> > run programs to shut down devices and reinit them after resume. This >> > isn't necessary in the shutdown case because init already sends a >> > signal, as you mention. >> > >> > There's already a mechanism for timing out if userland is not >> > responding, so a suspend will ultimately happen whether or not it >> > answers. However, that waits for a while (1 minute?) and devd used to be >> > optional, so I thought it best to keep the existing S5 behavior >> > (immediate shutdown). >> > >> > It may be ok to enable this for S5 but I don't think it's very useful. >> >> Perhaps a silly question, but is it too late at this stage of the game >> to try logging S5 events to syslog before dying? I agree with Stephen, >> logging 'shutdown by powerbutton' surely beats what might otherwise >> resemble a spontaneous reboot? Or is something already logged here? > > I'm not resisting this, but I'm having trouble seeing the importance. > What happens differently than if someone hits CTRL-ALT-DEL on a virtual > console? > Hi Nate, We have over 500 units in the field that are used as firewall/vpn/routers. They have no console, but they do have a powerbutton. We have had customers say the machine turned itself off. It would be nice to know that someone pressed the power button. Thanks, Steve -- "They that give up essential liberty to obtain temporary safety, deserve neither liberty nor safety." (Ben Franklin) "The course of history shows that as a government grows, liberty decreases." (Thomas Jefferson)