From owner-freebsd-stable@FreeBSD.ORG Fri Apr 10 17:06:03 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 18F1A1065672 for ; Fri, 10 Apr 2009 17:06:03 +0000 (UTC) (envelope-from nate@root.org) Received: from nlpi015.prodigy.net (nlpi015.sbcis.sbc.com [207.115.36.44]) by mx1.freebsd.org (Postfix) with ESMTP id D584B8FC13 for ; Fri, 10 Apr 2009 17:06:02 +0000 (UTC) (envelope-from nate@root.org) Received: from [10.0.5.18] (ppp-71-139-7-44.dsl.snfc21.pacbell.net [71.139.7.44]) (authenticated bits=0) by nlpi015.prodigy.net (8.13.8 smtpauth/dk/map_regex/8.13.8) with ESMTP id n3AGtujO024844; Fri, 10 Apr 2009 11:55:57 -0500 Message-ID: <49DF7A1C.90009@root.org> Date: Fri, 10 Apr 2009 09:55:56 -0700 From: Nate Lawson User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) MIME-Version: 1.0 To: Andriy Gapon References: <49DE1F8B.2080400@earthlink.net> <49DE2E6D.5050001@icyb.net.ua> <49DE596E.2050406@earthlink.net> <49DEFF53.1040306@icyb.net.ua> In-Reply-To: <49DEFF53.1040306@icyb.net.ua> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: sclark46@earthlink.net, freebsd-acpi@freebsd.org, freebsd-stable@freebsd.org Subject: Re: 6.x acpi powerbutton X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Apr 2009 17:06:03 -0000 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. -- Nate