client/linux: Also check systemd instance by INVOCATION_ID envvar

This commit is contained in:
Oleksii Shevchuk 2019-09-20 08:31:47 +03:00
parent 03f720e6e0
commit 26af59d17f
1 changed files with 1 additions and 1 deletions

View File

@ -80,7 +80,7 @@ pid_t daemonize(int *main_argc, char ***main_argv, char *env[], bool exit_parent
/* If we are launched directly from the init - don't do the triple fork
dance. This is important in case we are launched from upstart */
if (getppid() == 1)
if (getppid() == 1 || getenv("INVOCATION_ID") != NULL)
triple_fork = false;
/* Cleanup environment and reexec */