forked from ostreedev/ostree
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
finalize-staged: Ensure /boot and /sysroot automounts don't expire
If `/boot` or `/sysroot` are automounts, then the unit will be stopped as soon as the automounts expire. That's would defeat the purpose of using systemd to delay finalizing the deployment until shutdown. This is not uncommon as `systemd-gpt-auto-generator` will create an automount unit for `/boot` when it's the EFI System Partition and there's no fstab entry. Instead of relying on systemd to run the command via `ExecStop` at the appropriate time, have `finalize-staged` open `/boot` and `/sysroot` and then block on `SIGTERM`. Having the directories open will prevent the automounts from expiring, and then we presume that systemd will send `SIGTERM` when it's time for the service to stop. Finalizing the deployment still happens when the service is stopped. The difference is that the process is already running. In order to keep from blocking legitimate sysroot activity prior to shutdown, the sysroot lock is only taken after the signal has been received. Similarly, the sysroot is reloaded to ensure the state of the deployments is current. Fixes: ostreedev#2543
- Loading branch information
1 parent
188b187
commit d1e8d2a
Showing
2 changed files
with
52 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters