diff options
author | Martin Pitt <martin.pitt@ubuntu.com> | 2014-07-02 22:00:00 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-02-11 13:02:01 +0100 |
commit | f4f01ec146d91cb6943828851d98eee6a1ad4dd9 (patch) | |
tree | 7a9fa4a45f8b36cd63f4c95bfcf419088e3845d6 /src/sysv-generator | |
parent | f93b36affa5ac5710cd84bfb8ff0dafabe99fbf1 (diff) |
sysv-generator: Skip init scripts for existing native services
This avoids taking the SysV init script enablement state into account if we
have native units. Otherwise systemctl disable on native unit would not
be respected in the presence of an enabled SysV script.
Also, there's no need to do all the parsing and creation of service files if we
already have a native systemd unit for the processed SysV init script.
Diffstat (limited to 'src/sysv-generator')
-rw-r--r-- | src/sysv-generator/sysv-generator.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/sysv-generator/sysv-generator.c b/src/sysv-generator/sysv-generator.c index 673f04dc27..6e39b449eb 100644 --- a/src/sysv-generator/sysv-generator.c +++ b/src/sysv-generator/sysv-generator.c @@ -768,6 +768,11 @@ static int enumerate_sysv(LookupPaths lp, Hashmap *all_services) { if (!fpath) return log_oom(); + if (unit_file_get_state(UNIT_FILE_SYSTEM, NULL, name) >= 0) { + log_debug("Native unit for %s already exists, skipping", name); + continue; + } + service = new0(SysvStub, 1); if (!service) return log_oom(); @@ -852,7 +857,8 @@ static int set_dependencies_from_rcnd(LookupPaths lp, Hashmap *all_services) { service = hashmap_get(all_services, name); if (!service){ - log_warning("Could not find init script for %s", name); + log_debug("Ignoring %s symlink in %s, not generating %s.", + de->d_name, rcnd_table[i].path, name); continue; } |