]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/nspawn/nspawn.c
nspawn: add --console=autopipe mode 17082/head
authorLennart Poettering <lennart@poettering.net>
Thu, 17 Sep 2020 14:26:14 +0000 (16:26 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 17 Sep 2020 14:39:27 +0000 (16:39 +0200)
commit10e8a60baa2336b92419282a7f0373167d3f77fb
tree4b235513fde92556cdd4bc5d8f00c9aa215df44c
parent335d2eadca9e9d8fdac1afb2ceae86d75d815979
nspawn: add --console=autopipe mode

By default we'll run a container in --console=interactive and
--console=read-only mode depending if we are invoked on a tty or not so
that the container always gets a /dev/console allocated, i.e is always
suitable to run a full init system /as those typically expect a
/dev/console to exist).

With the new --console=autopipe mode we do something similar, but
slightly different: when not invoked on a tty we'll use --console=pipe.
This means, if you invoke some tool in a container with this you'll get
full inetractivity if you invoke it on a tty but things will also be
very nicely pipeable. OTOH you cannot invoke a full init system like
this, because you might or might not become a /dev/console this way...

Prompted-by: #17070
(I named this "autopipe" rather than "auto" or so, since the default
mode probably should be named "auto" one day if we add a name for it,
and this is so similar to "auto" except that it uses pipes in the
non-tty case).
man/systemd-nspawn.xml
src/nspawn/nspawn.c