]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
generator: order growfs for the root fs after systemd-remount-fs 14618/head
authorLennart Poettering <lennart@poettering.net>
Tue, 21 Jan 2020 09:40:18 +0000 (10:40 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 21 Jan 2020 09:40:18 +0000 (10:40 +0100)
Fixes: #14603
src/shared/generator.c

index 06e1ab803125d342fc8db4569930b0e7001fc480..1cf5887a60de1516bac1df3322d3abe8f1b4c5c3 100644 (file)
@@ -493,15 +493,21 @@ int generator_hook_up_growfs(
                 "BindsTo=%%i.mount\n"
                 "Conflicts=shutdown.target\n"
                 "After=%%i.mount\n"
-                "Before=shutdown.target %s\n"
+                "Before=shutdown.target %s\n",
+                program_invocation_short_name,
+                target);
+
+        if (empty_or_root(where)) /* Make sure the root fs is actually writable before we resize it */
+                fprintf(f,
+                        "After=systemd-remount-fs.service\n");
+
+        fprintf(f,
                 "\n"
                 "[Service]\n"
                 "Type=oneshot\n"
                 "RemainAfterExit=yes\n"
                 "ExecStart="SYSTEMD_GROWFS_PATH " %s\n"
                 "TimeoutSec=0\n",
-                program_invocation_short_name,
-                target,
                 escaped);
 
         return generator_add_symlink(dir, where_unit, "wants", unit);