summaryrefslogtreecommitdiff
path: root/src/systemctl/systemctl.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-04-07 18:48:01 +0200
committerLennart Poettering <lennart@poettering.net>2016-04-12 13:43:32 +0200
commit4943d14306c3e456525fdb793e7f48efea5b9236 (patch)
tree01ebe6e1d8ff0563f279d45e78c8ddfc0723a164 /src/systemctl/systemctl.c
parenta69b4fb0f80689b96f492a557368ed880365edee (diff)
systemctl: don't confuse sysv code with generated units
The SysV compat code checks whether there's a native unit file before looking for a SysV init script. Since the newest rework generated units will show up in the unit path, and hence the checks ended up assuming that there always was a native unit file for each init script: the generated one. With this change the generated unit file directory is suppressed from the search path when this check is done, to avoid the confusion.
Diffstat (limited to 'src/systemctl/systemctl.c')
-rw-r--r--src/systemctl/systemctl.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index 7c259ba06f..3344d25f77 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -4810,7 +4810,7 @@ static int cat(int argc, char *argv[], void *userdata) {
return -EINVAL;
}
- r = lookup_paths_init(&lp, arg_scope, arg_root);
+ r = lookup_paths_init(&lp, arg_scope, 0, arg_root);
if (r < 0)
return log_error_errno(r, "Failed to determine unit paths: %m");
@@ -5240,7 +5240,7 @@ static int enable_sysv_units(const char *verb, char **args) {
"is-enabled"))
return 0;
- r = lookup_paths_init(&paths, arg_scope, arg_root);
+ r = lookup_paths_init(&paths, arg_scope, LOOKUP_PATHS_EXCLUDE_GENERATED, arg_root);
if (r < 0)
return r;
@@ -6073,7 +6073,7 @@ static int find_paths_to_edit(sd_bus *bus, char **names, char ***paths) {
assert(names);
assert(paths);
- r = lookup_paths_init(&lp, arg_scope, arg_root);
+ r = lookup_paths_init(&lp, arg_scope, 0, arg_root);
if (r < 0)
return r;