diff options
author | Daniel Mack <github@zonque.org> | 2015-11-12 18:18:45 +0100 |
---|---|---|
committer | Daniel Mack <github@zonque.org> | 2015-11-12 18:18:45 +0100 |
commit | f1637bd3a81fe0468b53d7aa91b44cc0c34410d7 (patch) | |
tree | 60306026034427f5016a1da67cdb9d4689e2a5e9 /src/sysv-generator/sysv-generator.c | |
parent | 05c450966a08ff85fa8348e2fe41b722612fa3dc (diff) | |
parent | 79413b673b45adc98dfeaec882bbdda2343cb2f9 (diff) |
Merge pull request #1515 from poettering/install-symlink
install: follow unit file symlinks in /usr, but not /etc when looking for [Install] data and more
Diffstat (limited to 'src/sysv-generator/sysv-generator.c')
-rw-r--r-- | src/sysv-generator/sysv-generator.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/sysv-generator/sysv-generator.c b/src/sysv-generator/sysv-generator.c index 042be97840..5075548507 100644 --- a/src/sysv-generator/sysv-generator.c +++ b/src/sysv-generator/sysv-generator.c @@ -742,6 +742,7 @@ static int fix_order(SysvStub *s, Hashmap *all_services) { static int enumerate_sysv(const LookupPaths *lp, Hashmap *all_services) { char **path; + int r; assert(lp); assert(all_services); @@ -761,7 +762,6 @@ static int enumerate_sysv(const LookupPaths *lp, Hashmap *all_services) { _cleanup_free_ char *fpath = NULL, *name = NULL; _cleanup_(free_sysvstubp) SysvStub *service = NULL; struct stat st; - int r; if (fstatat(dirfd(d), de->d_name, &st, 0) < 0) { log_warning_errno(errno, "stat() failed on %s/%s, ignoring: %m", *path, de->d_name); @@ -781,8 +781,12 @@ static int enumerate_sysv(const LookupPaths *lp, Hashmap *all_services) { if (hashmap_contains(all_services, name)) continue; - if (unit_file_lookup_state(UNIT_FILE_SYSTEM, NULL, lp, name) >= 0) { - log_debug("Native unit for %s already exists, skipping", name); + r = unit_file_lookup_state(UNIT_FILE_SYSTEM, NULL, lp, name, NULL); + if (r < 0 && r != -ENOENT) { + log_debug_errno(r, "Failed to detect whether %s exists, skipping: %m", name); + continue; + } else if (r >= 0) { + log_debug("Native unit for %s already exists, skipping.", name); continue; } |