On 09.08.2017 11:28, Tilman Baumann wrote: > DL;DR > UPS shutdowns are tricky. Clean file-systems are not the only concern. > But if you can make assumptions about your storage backend you might be > able to cut corners safely. > > In my experience, the only place where you can hook in a non racy way is > in the kernel. > > https://unix.stackexchange.com/questions/122557/how-does-the-system-shutdown-of-a-linux-kernel-work-internally
Apologies, I copy and pasted the wrong link https://stackoverflow.com/questions/5938325/how-do-i-detect-reboot-shutdown-from-a-linux-driver The magic is here IIRC https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/tree/kernel/reboot.c _______________________________________________ systemd-devel mailing list systemd-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/systemd-devel