units: make fsck/grows/makefs/makeswap units conflict against shutdown.target

They are the only units we shipped/generated where this was missing really. Let's fix these.

Follow-up for: #10933
This commit is contained in:
Lennart Poettering 2018-11-26 17:38:52 +01:00
parent 020b39497a
commit ff9bf8d012
3 changed files with 9 additions and 8 deletions

View File

@ -103,9 +103,9 @@ static int write_fsck_sysroot_service(const char *dir, const char *what) {
"Documentation=man:systemd-fsck-root.service(8)\n"
"DefaultDependencies=no\n"
"BindsTo=%3$s\n"
"Conflicts=shutdown.target\n"
"After=initrd-root-device.target local-fs-pre.target %3$s\n"
"Before=shutdown.target\n"
"Conflicts=shutdown.target\n"
"\n"
"[Service]\n"
"Type=oneshot\n"
@ -345,9 +345,9 @@ int generator_hook_up_mkswap(
"Documentation=man:systemd-mkswap@.service(8)\n"
"DefaultDependencies=no\n"
"BindsTo=%%i.device\n"
"Conflicts=shutdown.target\n"
"After=%%i.device\n"
"Before=%s\n"
"Before=shutdown.target\n"
"Before=shutdown.target %s\n"
"\n"
"[Service]\n"
"Type=oneshot\n"
@ -420,12 +420,11 @@ int generator_hook_up_mkfs(
"Documentation=man:systemd-mkfs@.service(8)\n"
"DefaultDependencies=no\n"
"BindsTo=%%i.device\n"
"Conflicts=shutdown.target\n"
"After=%%i.device\n"
/* fsck might or might not be used, so let's be safe and order
* ourselves before both systemd-fsck@.service and the mount unit. */
"Before=systemd-fsck@%%i.service\n"
"Before=%s\n"
"Before=shutdown.target\n"
"Before=shutdown.target systemd-fsck@%%i.service %s\n"
"\n"
"[Service]\n"
"Type=oneshot\n"
@ -484,9 +483,9 @@ int generator_hook_up_growfs(
"Documentation=man:systemd-growfs@.service(8)\n"
"DefaultDependencies=no\n"
"BindsTo=%%i.mount\n"
"Conflicts=shutdown.target\n"
"After=%%i.mount\n"
"Before=shutdown.target\n"
"Before=%s\n"
"Before=shutdown.target %s\n"
"\n"
"[Service]\n"
"Type=oneshot\n"

View File

@ -11,6 +11,7 @@
Description=File System Check on Root Device
Documentation=man:systemd-fsck-root.service(8)
DefaultDependencies=no
Conflicts=shutdown.target
Before=local-fs.target shutdown.target
ConditionPathIsReadWrite=!/

View File

@ -12,6 +12,7 @@ Description=File System Check on %f
Documentation=man:systemd-fsck@.service(8)
DefaultDependencies=no
BindsTo=%i.device
Conflicts=shutdown.target
After=%i.device systemd-fsck-root.service local-fs-pre.target
Before=systemd-quotacheck.service shutdown.target