]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
nspawn: add a hint to the message we emit when a child dies
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 13 Nov 2018 08:02:01 +0000 (09:02 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 13 Nov 2018 10:58:44 +0000 (11:58 +0100)
From #10526:

$ sudo systemd-nspawn -i image
Spawning container image on /home/zbyszek/src/mkosi/image.
Press ^] three times within 1s to kill container.
Short read while reading cgroup mode.

src/nspawn/nspawn.c

index 9f69ee10a8d6f356caad95164f1260ac227d4f23..621968ef8e5e84da864c7aef28800da297e44c99 100644 (file)
@@ -3862,7 +3862,8 @@ static int run(int master,
                 if (l < 0)
                         return log_error_errno(errno, "Failed to read cgroup mode: %m");
                 if (l != sizeof(arg_unified_cgroup_hierarchy)) {
-                        log_error("Short read while reading cgroup mode.");
+                        log_error("Short read while reading cgroup mode (%zu bytes).%s",
+                                  l, l == 0 ? " The child is most likely dead." : "");
                         return -EIO;
                 }
         }