diff --git a/src/systemctl.c b/src/systemctl.c index 99ada38..33742ef 100644 --- a/src/systemctl.c +++ b/src/systemctl.c @@ -4159,14 +4159,6 @@ static int install_info_apply(const char *verb, LookupPaths *paths, InstallInfo return -ENOENT; } - /* Consider unit files stored in /lib and /usr always enabled - * if they have no [Install] data. */ - if (streq(verb, "is-enabled") && - strv_isempty(i->aliases) && - strv_isempty(i->wanted_by) && - !path_startswith(filename, "/etc")) - return 1; - i->path = filename; if ((r = config_parse(filename, f, NULL, items, true, i)) < 0) { @@ -4179,6 +4171,14 @@ static int install_info_apply(const char *verb, LookupPaths *paths, InstallInfo fclose(f); + /* Consider unit files stored in /lib and /usr always enabled + * if they have no [Install] data. */ + if (streq(verb, "is-enabled") && + strv_isempty(i->aliases) && + strv_isempty(i->wanted_by) && + !path_startswith(filename, "/etc")) + return 1; + if ((r = install_info_symlink_alias(verb, i, config_path)) != 0) return r;