Re: register runsvdir as subreaper

From: Mitar <mmitar_at_gmail.com>
Date: Thu, 2 Feb 2017 00:29:29 -0800

Hi!

On Wed, Feb 1, 2017 at 12:49 AM, Jonathan de Boyne Pollard
<J.deBoynePollard-newsgroups_at_ntlworld.com> wrote:
> You are talking to people well versed in the idea of chain-loading programs
> for affecting process state. The answer here is to simply run runsvdir
> through a chain-loading program that sets the process as a subreaper.
>
> You could write your own, or use the one that I wrote, packaged up, and
> published. I called it "local-reaper".
>
> * http://jdebp.eu./Softwares/nosh/guide/local-reaper.html

Very nice indeed. And as I see below you checked that it works with runsvdir.

It seems local-reaper is part of nosh, for which you provide a deb
package, but it is not included in Debian distribution. Is this
correct?

OK, so this could allow me to have a wrapper bash script which makes
sure processes inside Docker container are gracefully closed when
Docker container is stopped (see my other message to this mailing
list), and then I run runsvdir as PID 2 with local reaper chained
before it, so that any orphaned process is reaped by runsvdir. Because
it seems one cannot simply set:

trap "" SIGCHLD

in a PID 1 bash script. It seems it does not work. Because otherwise
one could just set SIGCHLD handler explicitly to SIG_IGN in PID 1 and
leave to the kernel to handle the orphaned processes.


Mitar

-- 
http://mitar.tnode.com/
https://twitter.com/mitar_m
Received on Thu Feb 02 2017 - 08:29:29 UTC

This archive was generated by hypermail 2.3.0 : Sun May 09 2021 - 19:44:19 UTC