ryantimwilson / rpms / systemd

Forked from rpms/systemd a month ago
Clone
923a60
From 7374770f790080b677f504075ba9659230e11226 Mon Sep 17 00:00:00 2001
923a60
From: Lukas Nykryn <lnykryn@redhat.com>
923a60
Date: Fri, 11 Sep 2015 16:23:07 +0200
923a60
Subject: [PATCH] sysv-generator: follow symlinks in /etc/rc.d/init.d
923a60
923a60
Some java packages puts a symlink to init.d and its content is pointing
923a60
to latest java installation (because you can have multiple javas on you
923a60
machine).
923a60
923a60
On rhel-based distributions you can use alternatives --initscript
923a60
instread of symlink, but this is not usable for other distributions.
923a60
923a60
Cherry-picked from: 7b729f8686a83b24f3d9a891cde1c
923a60
Resolves: #1285492
923a60
---
923a60
 src/sysv-generator/sysv-generator.c | 2 +-
923a60
 1 file changed, 1 insertion(+), 1 deletion(-)
923a60
923a60
diff --git a/src/sysv-generator/sysv-generator.c b/src/sysv-generator/sysv-generator.c
923a60
index 3c6cb8f10e..0a8a528bdc 100644
923a60
--- a/src/sysv-generator/sysv-generator.c
923a60
+++ b/src/sysv-generator/sysv-generator.c
923a60
@@ -753,7 +753,7 @@ static int enumerate_sysv(const LookupPaths *lp, Hashmap *all_services) {
923a60
                         if (hidden_file(de->d_name))
923a60
                                 continue;
923a60
 
923a60
-                        if (fstatat(dirfd(d), de->d_name, &st, AT_SYMLINK_NOFOLLOW) < 0) {
923a60
+                        if (fstatat(dirfd(d), de->d_name, &st, 0) < 0) {
923a60
                                 log_warning_errno(errno, "stat() failed on %s/%s: %m", *path, de->d_name);
923a60
                                 continue;
923a60
                         }