[systemd-commits] stable Branch 'v215-stable' - 2 commits - src/shared units/initrd-parse-etc.service.in

Harald Hoyer harald at kemper.freedesktop.org
Wed Sep 3 05:13:52 PDT 2014


 src/shared/base-filesystem.c      |    6 +++---
 units/initrd-parse-etc.service.in |    2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit acdc59d98a6ab4cd40bab6fc9486478b453cbcfb
Author: Harald Hoyer <harald at redhat.com>
Date:   Wed Sep 3 13:28:31 2014 +0200

    initrd-parse-etc.service: ignore return code of daemon-reload
    
    It seems the return code of systemctl daemon-reload can be !=0 in some
    circumstances, which causes a failure of the unit and breaks booting in
    the initrd.
    
    (cherry picked from commit f3b8fbb1da6519e14985ea444f8304673d20ad3f)

diff --git a/units/initrd-parse-etc.service.in b/units/initrd-parse-etc.service.in
index c0b2543..42c059b 100644
--- a/units/initrd-parse-etc.service.in
+++ b/units/initrd-parse-etc.service.in
@@ -16,7 +16,7 @@ ConditionPathExists=/etc/initrd-release
 
 [Service]
 Type=oneshot
-ExecStartPre=@rootbindir@/systemctl daemon-reload
+ExecStartPre=- at rootbindir@/systemctl daemon-reload
 # we have to retrigger initrd-fs.target after daemon-reload
 ExecStart=- at rootbindir@/systemctl --no-block start initrd-fs.target
 ExecStart=@rootbindir@/systemctl --no-block start initrd-cleanup.service

commit d518b11f1023c52183c5e05cee7fd29b5d7bbea8
Author: Harald Hoyer <harald at redhat.com>
Date:   Wed Sep 3 13:22:40 2014 +0200

    base_filesystem_create: do not try to create "/root" if it exists
    
    The check, if the directory/file already exists is only executed, if
    there is a symlink target specified. In case of "/root", there is none,
    so it is unconditionally tried to create the directory.
    
    In case of a readonly filesystem, errno != EEXIST, but errno == EROFS,
    so base_filesystem_create() and switch_root does not succeed.
    
    This patch checks for existance not only in the symlink case.
    
    (cherry picked from commit 6f4f8056d3f972c1e6ee7f5fc40ed283fd93152a)

diff --git a/src/shared/base-filesystem.c b/src/shared/base-filesystem.c
index addd26c..ba8b829 100644
--- a/src/shared/base-filesystem.c
+++ b/src/shared/base-filesystem.c
@@ -62,13 +62,13 @@ int base_filesystem_create(const char *root) {
                 return -errno;
 
         for (i = 0; i < ELEMENTSOF(table); i ++) {
+                if (faccessat(fd, table[i].dir, F_OK, AT_SYMLINK_NOFOLLOW) >= 0)
+                        continue;
+
                 if (table[i].target) {
                         const char *target = NULL;
                         const char *s;
 
-                        if (faccessat(fd, table[i].dir, F_OK, AT_SYMLINK_NOFOLLOW) >= 0)
-                                continue;
-
                         /* check if one of the targets exists */
                         NULSTR_FOREACH(s, table[i].target) {
                                 if (faccessat(fd, s, F_OK, AT_SYMLINK_NOFOLLOW) < 0)



More information about the systemd-commits mailing list