core: add IgnoreOnSoftReboot= unit option
As it says on the tin, configures the unit to survive a soft reboot. Currently all the following options have to be set by hand: Conflicts=reboot.target kexec.target poweroff.target halt.target Before=reboot.target kexec.target poweroff.target halt.target After=sysinit.target basic.target DefaultDependencies=no IgnoreOnIsolate=yes This is not very user friendly. If new default dependencies are added, or new shutdown/reboot types, they also have to be added manually. The new option is much simpler, easy to find, and does the right thing by default.
This commit is contained in:
committed by
Zbigniew Jędrzejewski-Szmek
parent
03d298e1e5
commit
b80fc61e89
@@ -136,11 +136,10 @@ rm "$T"
|
||||
exec sleep infinity
|
||||
EOF
|
||||
chmod +x "$T"
|
||||
# This sets DefaultDependencies=no so that it remains running until the
|
||||
# very end, and IgnoreOnIsolate=yes so that it isn't stopped via the
|
||||
# "testsuite.target" isolation we do on next boot
|
||||
systemd-run -p Type=notify -p DefaultDependencies=no -p IgnoreOnIsolate=yes --unit=testsuite-82-survive.service "$T"
|
||||
systemd-run -p Type=exec -p DefaultDependencies=no -p IgnoreOnIsolate=yes --unit=testsuite-82-nosurvive.service sleep infinity
|
||||
# Configure this transient unit to survive the soft reboot - it will not conflict with shutdown.target
|
||||
# and it will be ignored on the isolate that happens in the next boot.
|
||||
systemd-run -p Type=notify -p IgnoreOnSoftReboot=yes --unit=testsuite-82-survive.service "$T"
|
||||
systemd-run -p Type=exec -p IgnoreOnSoftReboot=yes --unit=testsuite-82-nosurvive.service sleep infinity
|
||||
|
||||
# Now issue the soft reboot. We should be right back soon.
|
||||
touch /run/testsuite82.touch
|
||||
|
||||
Reference in New Issue
Block a user