From 4943d14306c3e456525fdb793e7f48efea5b9236 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 7 Apr 2016 18:48:01 +0200 Subject: 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. --- src/shared/path-lookup.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/shared/path-lookup.h') diff --git a/src/shared/path-lookup.h b/src/shared/path-lookup.h index ad05c0c537..f9bb2fe237 100644 --- a/src/shared/path-lookup.h +++ b/src/shared/path-lookup.h @@ -26,6 +26,10 @@ typedef struct LookupPaths LookupPaths; #include "install.h" #include "macro.h" +typedef enum LookupPathsFlags { + LOOKUP_PATHS_EXCLUDE_GENERATED = 1, +} LookupPathsFlags; + struct LookupPaths { /* Where we look for unit files. This includes the individual special paths below, but also any vendor * supplied, static unit file paths. */ @@ -58,7 +62,7 @@ struct LookupPaths { char *root_dir; }; -int lookup_paths_init(LookupPaths *p, UnitFileScope scope, const char *root_dir); +int lookup_paths_init(LookupPaths *p, UnitFileScope scope, LookupPathsFlags flags, const char *root_dir); int lookup_paths_reduce(LookupPaths *p); -- cgit v1.2.3-54-g00ecf