sysv-generator: follow symlinks in /etc/rc.d/init.d
authorLukas Nykryn <lnykryn@redhat.com>
Fri, 11 Sep 2015 14:23:07 +0000 (16:23 +0200)
committerLukas Nykryn <lnykryn@redhat.com>
Fri, 11 Sep 2015 14:23:07 +0000 (16:23 +0200)
Some java packages puts a symlink to init.d and its content is pointing
to latest java installation (because you can have multiple javas on you
machine).

On rhel-based distributions you can use alternatives --initscript
instread of symlink, but this is not usable for other distributions.

src/sysv-generator/sysv-generator.c

index 45b1193..f9950c8 100644 (file)
@@ -739,7 +739,7 @@ static int enumerate_sysv(const LookupPaths *lp, Hashmap *all_services) {
                         if (hidden_file(de->d_name))
                                 continue;
 
-                        if (fstatat(dirfd(d), de->d_name, &st, AT_SYMLINK_NOFOLLOW) < 0) {
+                        if (fstatat(dirfd(d), de->d_name, &st, 0) < 0) {
                                 log_warning_errno(errno, "stat() failed on %s/%s: %m", *path, de->d_name);
                                 continue;
                         }