9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] safe power button
@ 2013-10-22  8:58 erik quanstrom
  0 siblings, 0 replies; only message in thread
From: erik quanstrom @ 2013-10-22  8:58 UTC (permalink / raw)
  To: 9fans

i thought this was a fun little hack with acpi, the nix kernel, and
cooperative hardware.

don't you hate it when you hit the power button and that moment of
doubt creaps in?  did i halt the system ... or not.  perhaps it hung?

solution.  teach the power button to just take care of this stuff.
here's the script, which requires to very recent patches to 9atom:

	dial/expect powerbutton< /dev/acpievent &&
		echo fshalt starting .... &&
		fshalt -h

fshalt -h echos "power off" into /dev/acpictl.

- erik



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-10-22  8:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-22  8:58 [9fans] safe power button erik quanstrom

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).