From owner-freebsd-acpi@freebsd.org Sun Sep 20 10:04:54 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 618F5A05F50 for ; Sun, 20 Sep 2015 10:04:54 +0000 (UTC) (envelope-from smithi@nimnet.asn.au) Received: from sola.nimnet.asn.au (paqi.nimnet.asn.au [115.70.110.159]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C9D15110B; Sun, 20 Sep 2015 10:04:52 +0000 (UTC) (envelope-from smithi@nimnet.asn.au) Received: from localhost (localhost [127.0.0.1]) by sola.nimnet.asn.au (8.14.2/8.14.2) with ESMTP id t8KA4juh078785; Sun, 20 Sep 2015 20:04:46 +1000 (EST) (envelope-from smithi@nimnet.asn.au) Date: Sun, 20 Sep 2015 20:04:45 +1000 (EST) From: Ian Smith To: Colin Percival cc: Anthony Jenkins , Jung-uk Kim , "freebsd-acpi@freebsd.org" Subject: Re: disabling sleep when shutting down In-Reply-To: <55FE5D54.1030806@freebsd.org> Message-ID: <20150920194946.U29510@sola.nimnet.asn.au> 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> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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: Sun, 20 Sep 2015 10:04:54 -0000 On Sun, 20 Sep 2015 00:16:36 -0700, Colin Percival wrote: > On 09/18/15 11:29, Anthony Jenkins wrote: > > Is it possible for /etc/rc.shutdown to complete, but shutdown not > > occur? If so, there should be a mechanism to restore the ability to > > suspend. Other than that, I like it. > > Hmm... well, rc.shutdown runs before the system drops into single-user > mode. Which makes me think that maybe we should be making the kernel > call from inside init instead of from rc.shutdown. I still think disabling suspend from shutdown.c, at the same time as creating /var/run/nologin might be the best way to go, to avoid any possibility of untimely suspending once committed to shutting down. For one thing, shutdown's -o flag bypasses using init and calls halt or reboot directly, though I don't know if anyone uses that. For another, if shutdown fails for any reason, or is cancelled by signal by the user .. or in any case, I gather .. finish() removes /var/run/nologin, and could also there reenable suspend, covering Anthony's point. cheers, Ian