]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
nspawn: ignore SIGPIPE for nspawn itself
authorLennart Poettering <lennart@poettering.net>
Sat, 26 Jan 2019 11:18:16 +0000 (12:18 +0100)
committerLennart Poettering <lennart@poettering.net>
Sat, 26 Jan 2019 12:54:44 +0000 (13:54 +0100)
Let's not abort due to a dead stdout.

Fixes: #11533
src/nspawn/nspawn.c

index 8e81f40e0db50b8286dd99b7ca8b999f9d518127..e0c2d711e60a9f3d17a202343ef01f55d5a7c1d1 100644 (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);