From owner-freebsd-acpi@freebsd.org Sat Sep 26 18:56:34 2015 Return-Path: Delivered-To: freebsd-acpi@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 27B48A0A385 for ; Sat, 26 Sep 2015 18:56:34 +0000 (UTC) (envelope-from bounces+73574-3fe6-freebsd-acpi=freebsd.org@sendgrid.net) Received: from o1.l99.sendgrid.net (o1.l99.sendgrid.net [198.37.153.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CDA24DDD for ; Sat, 26 Sep 2015 18:56:33 +0000 (UTC) (envelope-from bounces+73574-3fe6-freebsd-acpi=freebsd.org@sendgrid.net) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sendgrid.info; h=subject:to:references:cc:from:mime-version:in-reply-to:content-type:content-transfer-encoding; s=smtpapi; bh=pBAAtdDxX7ygDSkUvFWqC8H99mA=; b=M/NqvSAPftkC3gDXIC S4aTp9WXuZwGsDxlVVs3XRMcjtdLXfNXVgxDSfqoFEOAUftdCwv/HpGjgQf8lxXf /SXJ+ytbiYXKPK4JRnZUFU1SnL5pCFceDLz8TQ7axLUg0fs9tvM/Hd1Gyc9T4p5q J3VrkNzPOheoqz4B/fTz3acj0= Received: by filter0847p1mdw1.sendgrid.net with SMTP id filter0847p1mdw1.4873.5606EA5C38 2015-09-26 18:56:28.848223975 +0000 UTC Received: from mail.tarsnap.com (ec2-54-86-246-204.compute-1.amazonaws.com [54.86.246.204]) by ismtpd0001p1iad1.sendgrid.net (SG) with ESMTP id OsIq2dW0STOJlwjquVZhEg for ; Sat, 26 Sep 2015 18:56:28.773 +0000 (UTC) Received: (qmail 10359 invoked from network); 26 Sep 2015 18:56:15 -0000 Received: from unknown (HELO clamshell.daemonology.net) (127.0.0.1) by ec2-107-20-205-189.compute-1.amazonaws.com with ESMTP; 26 Sep 2015 18:56:15 -0000 Received: (qmail 50354 invoked from network); 26 Sep 2015 18:56:10 -0000 Received: from unknown (HELO clamshell.daemonology.net) (127.0.0.1) by clamshell.daemonology.net with SMTP; 26 Sep 2015 18:56:10 -0000 Subject: Re: disabling sleep when shutting down To: Ian Smith References: <55FA3848.7090802@freebsd.org> <55FB233D.2080000@FreeBSD.org> <55FB48E3.20401@freebsd.org> <55FC4F13.3090603@FreeBSD.org> <55FC57F9.3050702@yahoo.com> <55FE5D54.1030806@freebsd.org> <5601A863.5070406@FreeBSD.org> <560262BF.7090107@freebsd.org> <5602DE8D.3020102@FreeBSD.org> <560648A7.4030708@freebsd.org> <20150927024553.L29510@sola.nimnet.asn.au> Cc: Jung-uk Kim , John Baldwin , "freebsd-acpi@freebsd.org" , Dan Lukes From: Colin Percival X-Enigmail-Draft-Status: N1110 Message-ID: <5606EA4A.3090705@freebsd.org> Date: Sat, 26 Sep 2015 11:56:10 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <20150927024553.L29510@sola.nimnet.asn.au> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SG-EID: t2fXfoZHCw6vGsGKHqKxJ9qWwHSlQfPdDS+3+p6rOCutq7qM8UfANMMWic7mmEyMrTqkR5CCvNd54E nyaBbnNwSOQEPGPOYumkpAqMZ+xWc8bDJQhQp9xEPwzr0OLF9ejU9rmM7Jm17vgfp4Rk3SBUP1bU7d DhByhyb48Z7HkO5OGd3YYM05SO3Mn60fc1cl X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Sep 2015 18:56:34 -0000 On 09/26/15 10:59, Ian Smith wrote: > On Sat, 26 Sep 2015 00:26:31 -0700, Colin Percival wrote: > > Points without consensus: > > * jkim thinks we should prevent suspend when we're dropping to single-user > > mode; I'm not sure I see the point, but I don't think there's any harm in > > doing that too. > > We should prevent suspending _during_ shutdown to SU, of course. Once > happily in SU, is there any reason to disallow suspend? I've done it. I think the question here was about suspending during the shutdown to single-user mode. This seemed a bit different to me since it's not a "walk away from your laptop" sort of situation. But I've included it (or rather, not *excluded* it) anyway. > > * Ian Smith would like to have suspend blocked for the last 5 minutes before > > shutdown(8) signals init to shut the system down. I don't think anyone else > > has expressed a desire for this, and some people have raised concerns about > > blocking suspend for too long in case a system is running out of battery; so > > I'm inclined to leave this out at this point. (It would be easy enough to > > add the sysctl-frobbing to shutdown(8) if desired later.) > > Sorry, but that rather misrepresents my position; I was trying to deal > specifically with the LID foot-shooting potential, in the case of user- > initiated shutdown, so looking at possible mechanisms. Not to worry, I > clearly didn't express myself clearly :^\ Ok, so you're satisfied with having the suspend-disabling triggered by init (i.e., not happening until shutdown(8) reaches "now")? > +static void > +block_suspend(int block) > +{ > + > + sysctlbyname("kern.suspend_blocked", NULL, NULL, &block, > sizeof(block)); > +} > > This doesn't appear to get called? Err, yes. I wrote a helper function, then decided that since it was just one line I really didn't need to make it a helper function. Pretend it isn't there. ;-) > Any idea if any of this may not be straightforward to MFC, to 9 maybe? Should be trivial to MFC. -- Colin Percival Security Officer Emeritus, FreeBSD | The power to serve Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid