Skip to content

ptyfwd: a few fixes/cleanups - #32917

Merged
bluca merged 4 commits into
systemd:mainfrom
YHNdnzj:ptyfwd-cleanup
May 19, 2024
Merged

bluca merged 4 commits into
systemd:mainfrom
YHNdnzj:ptyfwd-cleanup

Conversation

@YHNdnzj

@YHNdnzj YHNdnzj commented May 19, 2024 •

Copy link
Copy Markdown
Member

Fixes #32916

YHNdnzj added 4 commits May 19, 2024 09:18
The rationale is similar to 40e1f4e.

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 systemd#32916
@github-actions github-actions Bot added vmspawn please-review PR is ready for (re-)review by a maintainer labels May 19, 2024
@github-actions

This comment has been minimized.

@YHNdnzj YHNdnzj added this to the v256 milestone May 19, 2024
@bluca
bluca merged commit d4d6a9e into systemd:main May 19, 2024
@github-actions github-actions Bot removed the please-review PR is ready for (re-)review by a maintainer label May 19, 2024
@YHNdnzj
YHNdnzj deleted the ptyfwd-cleanup branch May 19, 2024 12:50
Comment thread src/run/run.c

if (rcode < 0) {
if (rcode == -ECANCELED)
log_debug_errno(rcode, "PTY forwarder disconnected.");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, so you dropped the exiting of the event loop here?

is that intentional? commit msg doesn't mention this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

systemd-run --pty blocks indefinitely when printing in both ExecStartPre/ExecStopPost and main command

3 participants