From 4c08c8242a687e00b289e948ccd07b96f0bc4866 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 12 Feb 2015 12:21:16 +0100 Subject: core: don't fail to run services in --user instances if $HOME is missing Otherwise we cannot even invoke systemd-exit.service anymore, thus not even exit. https://bugs.freedesktop.org/show_bug.cgi?id=83100 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=759320 --- src/core/execute.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/core/execute.c') diff --git a/src/core/execute.c b/src/core/execute.c index 7b071e8c9e..1f6072c6ab 100644 --- a/src/core/execute.c +++ b/src/core/execute.c @@ -1617,7 +1617,8 @@ static int exec_child( return -errno; } - if (chdir(context->working_directory ? context->working_directory : "/") < 0) { + if (chdir(context->working_directory ?: "/") < 0 && + !context->working_directory_missing_ok) { *exit_status = EXIT_CHDIR; return -errno; } -- cgit v1.2.3-54-g00ecf