disabling sleep when shutting down

Ian Smith smithi at nimnet.asn.au
Sat Sep 19 15:16:54 UTC 2015


On Fri, 18 Sep 2015 13:51:15 -0400, Jung-uk Kim wrote:
 > On 09/17/2015 19:12, Colin Percival wrote:
 > > On 09/17/15 13:31, Jung-uk Kim wrote:
 > >> On 09/16/2015 23:49, Colin Percival wrote:
 > >>> I ran into an interesting glitch recently: I told my laptop to
 > >>> shut down, then closed the lid... and it promptly went into S3.
 > >>> When I opened the lid a couple days later, it resumed... and
 > >>> then finished the shutdown which it had started 2 days
 > >>> earlier.
 > >> 
 > >> Please try the attached patch.
 > > 
 > > No, this doesn't do what I wanted.  It might be a good idea anyway,
 > > but your patch only disables suspend once the kernel is trying to
 > > reboot; what I want is to disable suspend a bit earlier -- once
 > > rc.shutdown is running and the userland is trying to shut down,
 > > because at that point unless something breaks horribly we're *about
 > > to* tell the kernel to shut down even though we haven't gotten
 > > there quite yet.
 > 
 > Okay.  The attached patch is a quick-and-dirty & untested hack for you.

That looks .. comprehensive, given that it's run when rc.shutdown is 
called by init(8), if I'm correctly following the train of events from 
shutdown through init (unless -o) and then halt(8) or reboot(8).

Am I right assuming that if one ran say 'shutdown -p +2 [message]' then 
suspending would only be blocked after that interval has elapsed?

And with 'shutdown [-p|-h|-r] now' is there any appreciable delay (like
waiting on anything) before launching rc.shutdown?  i.e. anything that 
aforesaid fast lid-slammer might beat?

"Five minutes before shutdown, or immediately if shutdown is in less 
than 5 minutes, logins are disabled by creating /var/run/nologin and 
copying the warning message there."

Guess I'm still wondering if blocking suspend from shutdown, perhaps 
in a similar timeframe, might better prevent suspend-during-shutdown?

Aside perhaps, a point about acpiconf(8) I discovered tonight: every 
version of the man page since at least 5.5 states that S5 (soft off) is 
an option for -s.  That was true at 5.5, however acpiconf.c at least 
from 8.2 through 9.3 to HEAD (checked just now) allows only S1 to S4.

Noticed that because I was trying to find what else apart from shutdown, 
halt -p and the power button could initiate a poweroff halt.  Are there 
other ways, apart from doing it like acpiconf does?

cheers, Ian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: acpi.diff
Type: text/x-patch
Size: 4292 bytes
Desc: 
URL: <http://lists.freebsd.org/pipermail/freebsd-acpi/attachments/20150920/3974e404/attachment.bin>
-------------- next part --------------
_______________________________________________
freebsd-acpi at freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-acpi
To unsubscribe, send any mail to "freebsd-acpi-unsubscribe at freebsd.org"


More information about the freebsd-acpi mailing list