summaryrefslogtreecommitdiff
path: root/src/core/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/main.c')
-rw-r--r--src/core/main.c6
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) {