[systemd-devel] Running a service *just* before unmounting filesystems

Alexander E. Patrakov patrakov at gmail.com
Wed Jun 13 03:40:28 UTC 2018


Hans de Goede <hdegoede at redhat.com>:
>
> Hi All,
>
> So as you may have heard, I'm working on hiding the grub-menu
> by default on single OS Fedora Workstation.  Part of the plan
> here is to detect if a previous boot was successful and
> cleanly shutdown the machine and show the menu (not hide the
> menu) if the previous boot has failed to set either the
> boot_success or shutdown_success flags:
>
> https://fedoraproject.org/wiki/Changes/HiddenGrubMenu

I think that I have a possibly better idea regarding shutdown. The
idea is to modify GRUB so that it can see whether a filesystem has
been cleanly unmounted, and use this condition in the "if" blocks. If
the root filesystem has not been cleanly unmounted, then the shutdown
has likely failed, possibly because the user has pressed a power
button for 5 seconds. The problem with this solution is that, upon
hibernation, the filesystem will be always dirty (i.e.: false
positive), but we can probably manage it with another flag in grubenv.

-- 
Alexander E. Patrakov


More information about the systemd-devel mailing list