-
Notifications
You must be signed in to change notification settings - Fork 181
when used as system init; need to reclaim zombie processes #26
Comments
So, what is your problem? |
when you're comparing if you don't know the special responsibility when running as PID 1, you may refer to dumb-init (made by yelp engineering) or tini (integrated into docker 1.13+) [1] https://docs.docker.com/engine/admin/multi-service_container/
|
some 3rd party programs might start with a launcher shell script, like this one, if you ever run google-chrome inside a container with gosuv as the init, you may observe this from outside of the container, from 12022 ? Sl 0:00 | \_ docker-containerd-shim daa830f18e20d.../var/run/docker/libcontainerd
12041 pts/0 Ssl+ 0:00 | | \_ gosuv start-server -f
12118 ? Ssl 0:22 | | \_ Xvfb :10 -screen 0 1920x1480x24+32 -ac -r -cc 4 -accessx -xinerama +extension Composite -extension RANDR +ext
12121 ? Ssl 3:28 | | \_ /opt/google/chrome/chrome --no-first-run ...
[...]
12914 ? Z 0:00 | | \_ [cat] <defunct>
12915 ? Z 0:00 | | \_ [cat] <defunct> |
Understand |
Maybe can reference code https://github.com/driusan/dainit/blob/117d70e658fc1373adbca2bcb2fccdd956770088/zombie.go#L8 |
@c0b Can you test if it works. |
with current master code I'm still seeing some zombies |
Current code isn't very correct: because Linux signal system design follows SysV Unix behavior, when a SIGCHLD happens, it only means there are child programs died (either self-quit or involuntarily killed, from wstatus may figure out), linux kernel only deliver SIGCHLD once to parent before the parent process; so when SIGCHLD happens, you don't know is that one child only or more so the code need a loop until wait4 returns zero, at rumtime got this: ```console 2017/07/14 21:14:32 reap dead child: 579, wstatus: 0x00000000 2017/07/14 21:14:32 reap dead child: 580, wstatus: 0x00000000 2017/07/14 21:14:32 reap dead child: 583, wstatus: 0x00000000 ``` then in the container there are no more zombies. final resolve codeskyblue#26
linux kernel gives PID 1 with special responsibility to reclaim zombie process; otherwise zombies are accumulated more and more
The text was updated successfully, but these errors were encountered: