Skip to content
Commit 92f6078a authored by Andrey Ulanov's avatar Andrey Ulanov Committed by Zbigniew Jędrzejewski-Szmek
Browse files

nspawn: when getting SIGCHLD make sure it's from the first child (#4855)

When getting SIGCHLD we should not assume that it was the first
child forked from system-nspawn that has died as it may also be coming
from an orphan process. This change adds a signal handler that ignores
SIGCHLD unless it came from the first containerized child - the real
child.

Before this change the problem can be reproduced as follows:

$ sudo systemd-nspawn --directory=/container-root --share-system
Press ^] three times within 1s to kill container.
[root@andreyu-coreos ~]# { true & } &
[1] 22201
[root@andreyu-coreos ~]#
Container root-fedora-latest terminated by signal KILL
(cherry picked from commit 6916b164)
parent f04a5c9d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment