nspawn: when connected to pipes for stdin/stdout, pass them as-is to PID 1
authorLennart Poettering <lennart@poettering.net>
Wed, 18 Feb 2015 22:32:55 +0000 (23:32 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 18 Feb 2015 22:36:20 +0000 (23:36 +0100)
commit9c857b9d160c10b4454fc9f83442c1878343422f
treef6152bb50a8bb9dbf6fcecfc3599affa541d92b9
parent04155c67139fdd983f08e61e8a56d27341a4ea72
nspawn: when connected to pipes for stdin/stdout, pass them as-is to PID 1

Previously we always invoked the container PID 1 on /dev/console of the
container. With this change we do so only if nspawn was invoked
interactively (i.e. its stdin/stdout was connected to a TTY). In all other
cases we directly pass through the fds unmodified.

This has the benefit that nspawn can be added into shell pipelines.

https://bugs.freedesktop.org/show_bug.cgi?id=87732
src/machine/machinectl.c
src/nspawn/nspawn.c
src/run/run.c
src/shared/ptyfwd.c
src/shared/ptyfwd.h