From b663e9f1256c62fa0e1c0fb80e6cd4a3c055716d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Wed, 28 Sep 2022 13:38:56 +0200 Subject: [PATCH] shared/generator: apply similar config reordering of generated units (cherry picked from commit ce37fb0d92ca8af31215c81b573ebaac81ed6fd2) Related: #2190226 --- src/shared/generator.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/shared/generator.c b/src/shared/generator.c index 5d019f4f4e..4c684fc3e7 100644 --- a/src/shared/generator.c +++ b/src/shared/generator.c @@ -116,6 +116,7 @@ static int write_fsck_sysroot_service( "[Unit]\n" "Description=File System Check on %2$s\n" "Documentation=man:%3$s(8)\n" + "\n" "DefaultDependencies=no\n" "BindsTo=%4$s\n" "Conflicts=shutdown.target\n" @@ -409,11 +410,13 @@ int generator_hook_up_mkswap( "[Unit]\n" "Description=Make Swap on %%f\n" "Documentation=man:systemd-mkswap@.service(8)\n" + "\n" "DefaultDependencies=no\n" "BindsTo=%%i.device\n" - "Conflicts=shutdown.target\n" "After=%%i.device\n" - "Before=shutdown.target %s\n" + "Before=%s\n" + "Conflicts=shutdown.target\n" + "Before=shutdown.target\n" "\n" "[Service]\n" "Type=oneshot\n" @@ -486,13 +489,15 @@ int generator_hook_up_mkfs( "[Unit]\n" "Description=Make File System on %%f\n" "Documentation=man:systemd-makefs@.service(8)\n" + "\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=shutdown.target systemd-fsck@%%i.service %s\n" + "Before=systemd-fsck@%%i.service %s\n" + "Conflicts=shutdown.target\n" + "Before=shutdown.target\n" "\n" "[Service]\n" "Type=oneshot\n" @@ -624,11 +629,12 @@ int generator_write_cryptsetup_unit_section( fprintf(f, "SourcePath=%s\n", source); fprintf(f, + "\n" "DefaultDependencies=no\n" - "IgnoreOnIsolate=true\n" "After=cryptsetup-pre.target systemd-udevd-kernel.socket\n" "Before=blockdev@dev-mapper-%%i.target\n" - "Wants=blockdev@dev-mapper-%%i.target\n"); + "Wants=blockdev@dev-mapper-%%i.target\n" + "IgnoreOnIsolate=true\n"); return 0; }