summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2018-11-26 17:38:52 +0100
committerLennart Poettering <lennart@poettering.net>2018-11-26 22:18:16 +0100
commitff9bf8d01222fe28f89392a0ab17e2a96ea22da5 (patch)
tree1f6542e68f2037a6b11e00bb26e1627ce935eacb
parent020b39497a2a9f6699e984aa473753486d76e01d (diff)
downloadsystemd-ff9bf8d01222fe28f89392a0ab17e2a96ea22da5.tar.gz
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
-rw-r--r--src/shared/generator.c15
-rw-r--r--units/systemd-fsck-root.service.in1
-rw-r--r--units/systemd-fsck@.service.in1
3 files changed, 9 insertions, 8 deletions
diff --git a/src/shared/generator.c b/src/shared/generator.c
index cf5f3d6bcb..13591ac892 100644
--- a/src/shared/generator.c
+++ b/src/shared/generator.c
@@ -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"
diff --git a/units/systemd-fsck-root.service.in b/units/systemd-fsck-root.service.in
index 25aca1943f..042081ccee 100644
--- a/units/systemd-fsck-root.service.in
+++ b/units/systemd-fsck-root.service.in
@@ -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=!/
diff --git a/units/systemd-fsck@.service.in b/units/systemd-fsck@.service.in
index 078edcc01a..332208352d 100644
--- a/units/systemd-fsck@.service.in
+++ b/units/systemd-fsck@.service.in
@@ -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