mirror of
https://github.com/systemd/systemd.git
synced 2025-01-13 17:18:18 +03:00
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
This commit is contained in:
parent
54763e1266
commit
b77398f7a0
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user