Skip to content

openrc-user: keep the notify fd out of the login shell's stdout - #1114

Open
CodingVoid wants to merge 1 commit into
OpenRC:masterfrom
CodingVoid:notify-fd
Open

CodingVoid wants to merge 1 commit into
OpenRC:masterfrom
CodingVoid:notify-fd

Conversation

@CodingVoid

Copy link
Copy Markdown

spawn_openrc mapped the readiness pipe to the login shell's stdout, and openrc-user.sh later copied stdout to fd 3 before signalling. Anything a login shell startup file writes to stdout before openrc-user.sh reaches that line is mistaken for the readiness notification, which closes the read end. The real notification then dies with SIGPIPE and the user session is restarted until respawn-max is reached.

Keep fd 3 as the notify pipe, send shell output to stderr, signal on fd 3 and close it before exec'ing the runlevel.

spawn_openrc mapped the readiness pipe to the login shell's stdout,
and openrc-user.sh later copied stdout to fd 3 before signalling.
Anything a login shell startup file writes to stdout before
openrc-user.sh reaches that line is mistaken for the readiness
notification, which closes the read end. The real notification then dies
with SIGPIPE and the user session is restarted until respawn-max is
reached.

Keep fd 3 as the notify pipe, send shell output to stderr, signal on
fd 3 and close it before exec'ing the runlevel.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant