]> git.ipfire.org Git - thirdparty/systemd.git/commit
nspawn: when getting SIGCHLD make sure it's from the first child (#4855)
authorAndrey Ulanov <aulanov@gmail.com>
Tue, 13 Dec 2016 01:38:18 +0000 (17:38 -0800)
committerLennart Poettering <lennart@poettering.net>
Tue, 13 Dec 2016 01:38:18 +0000 (02:38 +0100)
commit6916b164642d8bb4938878f4284f8ee5ccf3efd6
tree93bd487bea06d59307608ad2361dcbe8a266f58c
parentbbc5d5286b39e9648186f7e05e6cc89aa295ee7a
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
src/nspawn/nspawn.c