On 01/30/2017 11:38 AM, Mitar wrote:
Hi!
I would like to ask if runsvdir could by default be defined as a
subreaper on Linux. If it is already a PID 1, then there is no
difference, but sometimes it is not. In that case when an orphan
process happens under it, then it would be re-parented under the
runsvdir, mimicking the behavior when runsvdir runs as a PID 1.
runit is often used in Docker containers and sometimes you have a
wrapper script which spawns runsvdir as a child. In that case runsvdir
does not run as PID 1.
I have found a similar patch for Debian, but which requested this
feature on runsv. I think that might be misused for making process who
demonize in fact stay under runsv. Or maybe that is a future feature
of runit, not sure, but that can be discussion for some other thread.
I would like to ask that something similar to that patch is done for
runsvdir for now:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=833048
This would really make it easier to use runit inside Docker.
A bit more about subreapers here:
https://unix.stackexchange.com/questions/250153/what-is-a-subreaper-process
Mitar
If you're looking to supervise processes inside containers, I'd
recommend checking out s6-overlay[1] - it's s6 + a collection of
scripts, meant to be used within containers for any Linux distro. It
handles reaping processes, logging, log rotation - it's a swiss army
knife. Full disclosure, I'm a member of the project :)
[1]: https://github.com/just-containers/s6-overlay