ryantimwilson / rpms / systemd

Forked from rpms/systemd a month ago
Clone
Blob Blame History Raw
From 9a36f797debf5f7dd240036a15c6942236c3e649 Mon Sep 17 00:00:00 2001
From: Colin Guthrie <colin@mageia.org>
Date: Sun, 9 Feb 2014 12:07:11 +0000
Subject: [PATCH] fstab-generator: Create fsck-root symlink with correct path

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(-)

diff --git a/src/fstab-generator/fstab-generator.c b/src/fstab-generator/fstab-generator.c
index 8c4c61c..0d954a2 100644
--- a/src/fstab-generator/fstab-generator.c
+++ b/src/fstab-generator/fstab-generator.c
@@ -177,7 +177,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;
                 }