X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fpath-lookup.c;h=b1c69814cade62115d1335087a0822dd970011dd;hb=a9dd208208e672a4fe5a3c2405946c1506e034db;hp=fff930469ca0ec6b9431f9e81c0a51ade8a6f928;hpb=2b583ce6576d4a074ce6f1570b3e60b65c64ae7d;p=elogind.git diff --git a/src/path-lookup.c b/src/path-lookup.c index fff930469..b1c69814c 100644 --- a/src/path-lookup.c +++ b/src/path-lookup.c @@ -102,7 +102,11 @@ static char** user_dirs(void) { if ((e = getenv("XDG_DATA_DIRS"))) data_dirs = strv_split(e, ":"); else - data_dirs = strv_new("/usr/local/share", "/usr/share", NULL); + data_dirs = strv_new("/usr/local/share", + "/usr/local/lib", + "/usr/share", + "/usr/lib", + NULL); if (!data_dirs) goto fail; @@ -187,7 +191,9 @@ int lookup_paths_init(LookupPaths *p, ManagerRunningAs running_as) { SYSTEM_CONFIG_UNIT_PATH, "/etc/systemd/system", "/usr/local/share/systemd/system", + "/usr/local/lib/systemd/system", "/usr/share/systemd/system", + "/usr/lib/systemd/system", "/lib/systemd/system", SYSTEM_DATA_UNIT_PATH, NULL))) @@ -199,6 +205,7 @@ int lookup_paths_init(LookupPaths *p, ManagerRunningAs running_as) { return -ENOMEM; strv_uniq(p->unit_path); + strv_path_remove_empty(p->unit_path); if (!strv_isempty(p->unit_path)) { @@ -253,6 +260,9 @@ int lookup_paths_init(LookupPaths *p, ManagerRunningAs running_as) { strv_uniq(p->sysvinit_path); strv_uniq(p->sysvrcnd_path); + strv_path_remove_empty(p->sysvinit_path); + strv_path_remove_empty(p->sysvrcnd_path); + if (!strv_isempty(p->sysvinit_path)) { if (!(t = strv_join(p->sysvinit_path, "\n\t")))