summaryrefslogtreecommitdiff
path: root/src/path-lookup.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2011-07-22 04:17:38 +0200
committerLennart Poettering <lennart@poettering.net>2011-07-22 04:31:20 +0200
commitc800e483748a8bb68ed405094c265954c7e605dc (patch)
treeca2b765e04ad191c365b971f9779d7ed2a670742 /src/path-lookup.c
parentd8eaa1144f7ea921ae9eb4bba1f6a7c1797c9435 (diff)
path-lookup: make inclusion of user private units optional
Diffstat (limited to 'src/path-lookup.c')
-rw-r--r--src/path-lookup.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/src/path-lookup.c b/src/path-lookup.c
index b45467c98d..84a9859254 100644
--- a/src/path-lookup.c
+++ b/src/path-lookup.c
@@ -163,7 +163,7 @@ fail:
goto finish;
}
-int lookup_paths_init(LookupPaths *p, ManagerRunningAs running_as) {
+int lookup_paths_init(LookupPaths *p, ManagerRunningAs running_as, bool personal) {
const char *e;
char *t;
@@ -181,8 +181,27 @@ int lookup_paths_init(LookupPaths *p, ManagerRunningAs running_as) {
strv_free(p->unit_path);
if (running_as == MANAGER_USER) {
- if (!(p->unit_path = user_dirs()))
+
+ if (personal)
+ p->unit_path = user_dirs();
+ else
+ p->unit_path = strv_new(
+ /* If you modify this you also want to modify
+ * systemduserunitpath= in systemd.pc.in, and
+ * the arrays in user_dirs() above! */
+ "/run/systemd/user",
+ USER_CONFIG_UNIT_PATH,
+ "/etc/systemd/system",
+ "/usr/local/lib/systemd/user",
+ "/usr/local/share/systemd/user",
+ USER_DATA_UNIT_PATH,
+ "/usr/lib/systemd/user",
+ "/usr/share/systemd/user",
+ NULL);
+
+ if (!p->unit_path)
return -ENOMEM;
+
} else
if (!(p->unit_path = strv_new(
/* If you modify this you also want to modify
@@ -192,8 +211,8 @@ int lookup_paths_init(LookupPaths *p, ManagerRunningAs running_as) {
"/etc/systemd/system",
"/usr/local/lib/systemd/system",
"/usr/lib/systemd/system",
- "/lib/systemd/system",
SYSTEM_DATA_UNIT_PATH,
+ "/lib/systemd/system",
NULL)))
return -ENOMEM;
}