News for hackers. Stuff that matters.
Re:How we built a Smart Office system based on Raspberry Pi by analog31 on Sunday October 23, 2016 @02:27PM (#12774706)
That's what I would do. The loss of 5 V on the GPIO pin triggers a interrupt, which forces a graceful shutdown. As I understand it, there's a command which halts disk access, which is mainly what's needed for a graceful shutdown.
Re:How we built a Smart Office system based on Raspberry Pi by washadjeffmad on Sunday October 23, 2016 @05:23PM (#12775497)
You can use "systemctl poweroff", /sbin/shutdown, "shutdown -Ph now" (in case of wonky ACPI), and a few others to gracefully halt.

You can also echo a magic sysrq key (eg-"b") to /proc/sysrq-trigger. "e i s u o" would do the full graceful shutdown. This nicely asks processes to quit, kills (almost) everything, halts the system, syncs disks, and remounts fs ro before going down.

Or you could create a service with systemd to (run a script to) check when dbus gets a particular signal, like a network device being added or removed if an SSID disappearing was your indicator of power loss, then halt.

I'd probably just plug them into a UPS, though. Just have it send one of the shutdowns to the "master" when running battery power for longer than a few minutes.