]> git.ipfire.org Git - thirdparty/systemd.git/commit
run: pass the pty slave fd to transient service 32917/head
authorMike Yuan <me@yhndnzj.com>
Sun, 19 May 2024 01:07:21 +0000 (09:07 +0800)
committerMike Yuan <me@yhndnzj.com>
Sun, 19 May 2024 01:18:48 +0000 (09:18 +0800)
commit28459ba1f4df824d5ef7f7d1a9acb6953ea24045
tree15c801c5c435f7198d2fe0fb1f93f34875ae217d
parentade0789fabbf01b95bf54d32f8cab1217a753f03
run: pass the pty slave fd to transient service

The rationale is similar to 40e1f4ea7458a0a80eaf1ef356e52bfe0835412e.

Currently, we only pass TTYPath=/dev/pts/... to
the transient service spawned by systemd-run.
This is a bit problematic though, when ExecStartPre=
or ExecStopPost= is used. Since when these control
processes get to run, the main process is not yet
started/has already exited, hence the slave suffers
from the same vhangup problem as the mentioned commit.

By passing the slave fd in, the service manager will
hold the fd open as long as the service is alive.

Fixes #32916
src/run/run.c