summaryrefslogtreecommitdiff
path: root/src/core/manager.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-03-03 17:14:07 +0100
committerLennart Poettering <lennart@poettering.net>2014-03-03 17:55:32 +0100
commite66cf1a3f94fff48a572f6dbd19b43c9bcf7b8c7 (patch)
treee3580f7a1e9aaca01ada8575a1ea50a7a32dd2d3 /src/core/manager.c
parentb64a3d86bcc3b3698824019d0ebdc2117ad31bb5 (diff)
core: introduce new RuntimeDirectory= and RuntimeDirectoryMode= unit settings
As discussed on the ML these are useful to manage runtime directories below /run for services.
Diffstat (limited to 'src/core/manager.c')
-rw-r--r--src/core/manager.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/core/manager.c b/src/core/manager.c
index 9172a244ae..822c7ccfee 100644
--- a/src/core/manager.c
+++ b/src/core/manager.c
@@ -2851,3 +2851,10 @@ Set *manager_get_units_requiring_mounts_for(Manager *m, const char *path) {
return hashmap_get(m->units_requiring_mounts_for, streq(p, "/") ? "" : p);
}
+
+const char *manager_get_runtime_prefix(Manager *m) {
+
+ return m->running_as == SYSTEMD_SYSTEM ?
+ "/run" :
+ getenv("XDG_RUNTIME_DIR");
+}