Unverified Commit 75af4379 authored by boklm's avatar boklm
Browse files

Bug 23454: restore stderr in build logs

In #23425 we redirected the output from runc start to /dev/null to
avoid annoying messages saying "stdin: is not a tty". However this also
removes stderr from build logs.

The command producing the `stdin: is not a tty` message is the `chown -R`
command from runc/remote_put, so we now only hide stderr from that
part while keeping it for the runc command running the build script.
parent 84881888
......@@ -329,7 +329,7 @@ runc:
cat > '[% c("var/container/dir") %]'/config.json << EOF
[% INCLUDE 'runc-config.json' %]
EOF
sudo runc start -b '[% c("var/container/dir") %]' rbm-[% sha256(c("build_id", { error_if_undef => 1 })) %] [% IF ! c("interactive") %]2>/dev/null[% END %]
sudo runc start -b '[% c("var/container/dir") %]' rbm-[% sha256(c("build_id", { error_if_undef => 1 })) %] [% IF c("runc_hide_stderr") %]2>/dev/null[% END %]
remote_put: |
#!/bin/sh
......@@ -340,7 +340,10 @@ runc:
-%]
sudo mkdir -p '[% c("var/container/dir") %]'/rootfs/[% dst %]
sudo cp -aP [% src %] '[% c("var/container/dir") %]'/rootfs/[% dst %]
[% c("remote_exec", { exec_as_root => 1, exec_cmd => 'chown -R ' _ c("var/container/user") _ ' ' _ dst }) %]
# On Ubuntu, the /root/.profile file contains a `mesg n` line which is
# producing some `stdin: is not a tty` messages. To hide them, we hide
# stderr from this part by setting runc_hide_stderr.
[% c("remote_exec", { exec_as_root => 1, exec_cmd => 'chown -R ' _ c("var/container/user") _ ' ' _ dst, runc_hide_stderr => 1 }) %]
remote_get: |
#!/bin/sh
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment