summaryrefslogtreecommitdiffstats
path: root/src/home/homed-home.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2021-01-31 16:52:59 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2021-01-31 17:19:52 +0100
commitd754890843db3c2784b4299fc9b9b6968e2ad533 (patch)
tree3b4a2225beeeb40f6b231bc3ddad768dd481435c /src/home/homed-home.c
parentcore: also set $SYSTEMD_EXEC_PID= for generators (diff)
downloadsystemd-d754890843db3c2784b4299fc9b9b6968e2ad533.tar.xz
systemd-d754890843db3c2784b4299fc9b9b6968e2ad533.zip
import,home: update $SYSTEMD_EXEC_PID= if it is set
The subsequent execv() or execl() always calls tools provided by systemd. So, it is safe to update the variable.
Diffstat (limited to 'src/home/homed-home.c')
-rw-r--r--src/home/homed-home.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/home/homed-home.c b/src/home/homed-home.c
index 38b7e20ca6..2ea0f7c81d 100644
--- a/src/home/homed-home.c
+++ b/src/home/homed-home.c
@@ -1038,6 +1038,10 @@ static int home_start_work(Home *h, const char *verb, UserRecord *hr, UserRecord
_exit(EXIT_FAILURE);
}
+ r = setenv_systemd_exec_pid(true);
+ if (r < 0)
+ log_warning_errno(r, "Failed to update $SYSTEMD_EXEC_PID, ignoring: %m");
+
r = rearrange_stdio(stdin_fd, stdout_fd, STDERR_FILENO);
if (r < 0) {
log_error_errno(r, "Failed to rearrange stdin/stdout/stderr: %m");