From: Lennart Poettering Date: Sat, 26 Jan 2019 11:18:16 +0000 (+0100) Subject: nspawn: ignore SIGPIPE for nspawn itself X-Git-Tag: v241-rc1~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2949ff26911b165d3c5452df7b09471d289f9ad9;p=thirdparty%2Fsystemd.git nspawn: ignore SIGPIPE for nspawn itself Let's not abort due to a dead stdout. Fixes: #11533 --- diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c index 8e81f40e0db..e0c2d711e60 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);