[systemd-devel] [PATCH] fstab-generator: Create fsck-root symlink with correct path

Colin Guthrie colin at mageia.org
Sun Feb 9 04:07:11 PST 2014


This was noticed in Brussels at the hackfest. The fstab-generator currently
creates a broken symlink pointing to itself in
/run/systemd/generator/local-fs.target.wants/ for systemd-fsck-root.service

---
 src/fstab-generator/fstab-generator.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



Not sure if this should really check for /etc... units, but other generators
e.g. the rc-local doesn't do that so I presume it's OK like this.




diff --git a/src/fstab-generator/fstab-generator.c b/src/fstab-generator/fstab-generator.c
index 5480e54..0336888 100644
--- a/src/fstab-generator/fstab-generator.c
+++ b/src/fstab-generator/fstab-generator.c
@@ -176,7 +176,7 @@ static int add_fsck(FILE *f, const char *what, const char *where, const char *ty
 
                 lnk = strappenda(arg_dest, "/" SPECIAL_LOCAL_FS_TARGET ".wants/systemd-fsck-root.service");
                 mkdir_parents_label(lnk, 0755);
-                if (symlink("systemd-fsck-root.service", lnk) < 0) {
+                if (symlink(SYSTEM_DATA_UNIT_PATH "/systemd-fsck-root.service", lnk) < 0) {
                         log_error("Failed to create symlink %s: %m", lnk);
                         return -errno;
                 }
-- 
1.8.4.5



More information about the systemd-devel mailing list