summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2019-01-26 12:18:16 +0100
committerLennart Poettering <lennart@poettering.net>2019-01-26 13:54:44 +0100
commit2949ff26911b165d3c5452df7b09471d289f9ad9 (patch)
tree2d7eab3a2acda3d94658865a8db06e5a3d5af3ce
parenteb1ec489eef8a32918bbfc56a268c9d10464584d (diff)
downloadsystemd-2949ff26911b165d3c5452df7b09471d289f9ad9.tar.gz
nspawn: ignore SIGPIPE for nspawn itself
Let's not abort due to a dead stdout. Fixes: #11533
-rw-r--r--src/nspawn/nspawn.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
index 8e81f40e0d..e0c2d711e6 100644
--- a/src/nspawn/nspawn.c
+++ b/src/nspawn/nspawn.c
@@ -4230,6 +4230,11 @@ int main(int argc, char *argv[]) {
if (r < 0)
goto finish;
+ /* Ignore SIGPIPE here, because we use splice() on the ptyfwd stuff and that will generate SIGPIPE if
+ * the result is closed. Note that the container payload child will reset signal mask+handler anyway,
+ * so just turning this off here means we only turn it off in nspawn itself, not any children. */
+ (void) ignore_signals(SIGPIPE, -1);
+
n_fd_passed = sd_listen_fds(false);
if (n_fd_passed > 0) {
r = fdset_new_listen_fds(&fds, false);