diff options
author | Mantas MikulÄ—nas <grawity@gmail.com> | 2013-10-09 14:57:13 +0300 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2013-11-07 01:27:15 -0500 |
commit | 3f6da75bcef8293382ce2674322f6c50428eb39f (patch) | |
tree | dbf33db437f8a61515e768c73cbe788959579522 | |
parent | aed2ebfed00acdc5db1542be499f6a0d71a76f08 (diff) |
core: require $XDG_RUNTIME_DIR to be set for user instances
It seems that some places use /run otherwise, which isn't going to work.
-rw-r--r-- | src/core/main.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/core/main.c b/src/core/main.c index b62234ed45..d161968bb3 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -1383,6 +1383,12 @@ int main(int argc, char *argv[]) { goto finish; } + if (arg_running_as == SYSTEMD_USER && + !getenv("XDG_RUNTIME_DIR")) { + log_error("Trying to run as user instance, but \$XDG_RUNTIME_DIR is not set."); + goto finish; + } + if (arg_running_as == SYSTEMD_SYSTEM && arg_action == ACTION_RUN && running_in_chroot() > 0) { |