diff options
author | Michal Schmidt <mschmidt@redhat.com> | 2011-06-13 14:19:47 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2011-06-14 21:58:29 +0200 |
commit | b77398f7a05aa313cebcea81e9381833bede2d61 (patch) | |
tree | f9c7043c20be2bf29f930d5522833bf6a8d6f9c8 /src/systemctl.c | |
parent | 54763e12662d465a038c424ea7baf565cca7be76 (diff) |
systemctl: fix 'is-enabled' for native units under /lib
The units always showed up as enabled.
The config file has to be parsed before we can check what's in
the [Install] section.
https://bugzilla.redhat.com/show_bug.cgi?id=699027
Diffstat (limited to 'src/systemctl.c')
-rw-r--r-- | src/systemctl.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/systemctl.c b/src/systemctl.c index faca797565..889e3ee064 100644 --- a/src/systemctl.c +++ b/src/systemctl.c @@ -4160,6 +4160,13 @@ static int install_info_apply(const char *verb, LookupPaths *paths, InstallInfo return -ENOENT; } + i->path = filename; + + if ((r = config_parse(filename, f, NULL, items, true, i)) < 0) { + fclose(f); + return r; + } + /* Consider unit files stored in /lib and /usr always enabled * if they have no [Install] data. */ if (streq(verb, "is-enabled") && @@ -4168,13 +4175,6 @@ static int install_info_apply(const char *verb, LookupPaths *paths, InstallInfo !path_startswith(filename, "/etc")) return 1; - i->path = filename; - - if ((r = config_parse(filename, f, NULL, items, true, i)) < 0) { - fclose(f); - return r; - } - n_symlinks += strv_length(i->aliases); n_symlinks += strv_length(i->wanted_by); |