Skip to content

Conversation

@adeg
Copy link

@adeg adeg commented Sep 28, 2025

Using runuser fixes the interactive login on Debian 13 based containers.

When login -p -f ${USERNAME} is executed by container-create-user.sh, the process is stopped by SIGTTOU after attempted call of TCSETS. Debugging login in D12 showed that it was using a different call - SNDCTL_TMR_START about which strace is not fully certain reporting it as "SNDCTL_TMR_START or TCSETS". The likely reason that this was a bug in earlier versions of login fixed in the version included in D13. TCSETS (now, when used properly) is subject to job control leading to the login process being stopped by SIGTTOU.

runuser doesn't have the complex session and terminal handling that login does and is currently the recommended way to run commands as other users without requiring authentication. runuser has been available since Debian 8, so backward compatibility is preserved.

Tested with Debian 10, 12 and 13 based containers, verifying that initial container shell successfully starts and it is possible to start additional shells with due --login. Also compared the output of set in login-based and runuser-based shells: the latter miss HUSHLOGIN, MAIL, MOTD_SHOWN; these env vars do not seem to be critical for build environments.

…atibility

Using `runuser` fixes the interactive login on Debian 13 based containers.

When `login -p -f ${USERNAME}` is executed by container-create-user.sh, the
process is stopped by SIGTTOU after attempted call of TCSETS. Debugging `login`
in D12 showed that it was using a different call - SNDCTL_TMR_START about which
strace is not fully certain reporting it as "SNDCTL_TMR_START or TCSETS". The
likely reason that this was a bug in earlier versions of login fixed in the
version included in D13. TCSETS (now, when used properly) is subject to job
control leading to the `login` process being stopped by SIGTTOU.

runuser doesn't have the complex session and terminal handling that login does
and is currently the recommended way to run commands as other users without
requiring authentication. runuser has been available since Debian 8, so
backward compatibility is preserved.

Tested with Debian 10, 12 and 13 based containers, verifying that initial
container shell successfully starts and it is possible to start additional
shells with `due --login`. Also compared the output of `set` in login-based and
runuser-based shells: the latter miss HUSHLOGIN, MAIL, MOTD_SHOWN; these env
vars do not seem to be critical for build environments.

Signed-off-by: Anton Degtyarev <adeg47@gmail.com>
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