codeskyblue/gosuv

when used as system init; need to reclaim zombie processes

Closed this issue · 8 comments

c0b commented

linux kernel gives PID 1 with special responsibility to reclaim zombie process; otherwise zombies are accumulated more and more

# ps f -e | grep Z
[...]
   41 ?        Z      0:00 [cat] <defunct>
   42 ?        Z      0:00 [cat] <defunct>

So, what is your problem?

c0b commented

when you're comparing gosuv with supervisor, did you consider all use cases of supervisor ? you may be aware that a common use case with supervisor is as init of multi services in container, it is a good and slim one if compare supervisor with the more traditional SysV-init or the new systemd style, it served well the purpose of multi-service_container; however because Supervisor/supervisor#122 such a high-demand feature can't be fixed for 5 years (since it was opened in 2012), one can reasonably guess that project is going out of maintenance; and I do see this project has potential to serve that purpose better

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/
[2] https://engineeringblog.yelp.com/2016/01/dumb-init-an-init-for-docker.html
[3] https://github.com/krallin/tini
[4] https://docs.docker.com/engine/reference/commandline/run/#options

Name, shorthand Default Description
--init false Run an init inside the container that forwards signals and reaps processes
c0b commented

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 ps f -e notice the [cat] in zombie state, those were launched by chrome's launch script but they got somewhere abandoned, to regular linux system design, the init (either SysVinit or Systemd) will reap the zombies

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

@c0b Can you test if it works.

c0b commented

with current master code I'm still seeing some zombies