nspawn: ignore SIGPIPE for nspawn itself

Let's not abort due to a dead stdout.

Fixes: #11533
This commit is contained in:
Lennart Poettering 2019-01-26 12:18:16 +01:00
parent eb1ec489ee
commit 2949ff2691

View file

@ -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);