Skip to content

Commit

Permalink
commands: Set nspawn console mode to pipe
Browse files Browse the repository at this point in the history
Currently the default nspawn console mode for nspawn is interactive which
means that /dev/console is created inside the nspawn container and the
command can assume it is running in an interactive session.

With console mode set to pipe, nspawn doesn't create /dev/console inside
the container and scripts assume they are running in an interactive
environment

This has the benefit of forcing some commands (e.g. apt) to not show things
like progress bars which only work in interactive terminals.

Fixes: #411
Fixes: #416
Signed-off-by: Christopher Obbard <[email protected]>
  • Loading branch information
obbardc committed Feb 6, 2024
1 parent f21bdfd commit 8f80ad8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ func (cmd Command) Run(label string, cmdline ...string) error {
options = append(options, "--timezone=off")
options = append(options, "--register=no")
options = append(options, "--keep-unit")
options = append(options, "--console=pipe")
for _, e := range cmd.extraEnv {
options = append(options, "--setenv", e)

Expand Down

0 comments on commit 8f80ad8

Please sign in to comment.