From 3f6da75bcef8293382ce2674322f6c50428eb39f Mon Sep 17 00:00:00 2001 From: Mantas Mikulėnas Date: Wed, 9 Oct 2013 14:57:13 +0300 Subject: 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. --- src/core/main.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/core/main.c') 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) { -- cgit v1.2.3-54-g00ecf