Re: register runsvdir as subreaper

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

Hi!

Hm, when I read the runit man page I got scared because of its trying
to reboot and halt the machine. I am not sure how will that interact
with a Docker container. I also didn't want one extra process to be in
every container. But you are right, it seems it might be necessary
anyway.

So, let 'see. I could simply then use runit as PID 1 inside a Docker
image. /etc/runit/1 could be an empty script (is it even required to
have it, if not needed?). /etc/runit/2 would then start runsvdir.
Should it exec into it?

I would then map Docker stop signal to be SIGINT, and I would create a
/etc/runit/ctrlaltdel script which would gracefully call stop on all
services. Or does runit already do that?

If /etc/runit/stopit does not exit, then sending the SIGINT signal to
runit does not do anything besides running the /etc/runit/ctrlaltdel
script?


Mitar

On Thu, Feb 2, 2017 at 10:59 AM, Steve Litt <slitt_at_troubleshooters.com> wrote:
> If you have a choice of what Docker calls as PID1, why not just have it
> call the runit executable, which will call sv's for level 1 and 2 and
> then run runsvdir. Then you have a PID1 that does all the right things.
>
> SteveT
>
> On Thu, 2 Feb 2017 00:34:48 -0800
> Mitar <mmitar_at_gmail.com> wrote:
>
>> Hi!
>>
>> It depends how once organizes its container, but it is pretty normal
>> that one calls runsvdir as the PID 1 in the Docker container. So that
>> Docker runtime, when it is creating the container, calls directly the
>> runsvdir on one directory, which contains all the services inside the
>> Docker container.
>>
>>
>> Mitar
>>
>> On Wed, Feb 1, 2017 at 9:55 AM, Steve Litt
>> <slitt_at_troubleshooters.com> wrote:
>> > On Wed, 1 Feb 2017 12:09:01 -0500
>> > Roger Pate <roger_at_qxxy.com> wrote:
>> >
>> >> On Wed, Feb 1, 2017 at 11:48 AM, Laurent Bercot
>> >> <ska-skaware_at_skarnet.org> wrote:
>> >> > You want a clean process tree with a visually pleasing "ps
>> >> > afuxww" output? Fix your services so they don't leave orphans in
>> >> > the first place. ...
>> >> > Reparenting orphans to anything else than the default is a
>> >> > backwards way to solve a nonexistent problem.
>> >>
>> >> Name it reaperhack:
>> >> reaperhack is what it says: a hack. Ideally, you should never
>> >> have to use it. It is only useful when you want to supervise a
>> >> daemon that results in orphans; and even then, the right thing is
>> >> to report this as a bug to the author of the program leaving
>> >> orphans and have it fixed.
>> >
>> > Am I missing something? Do containers not have a PID1? If so, what
>> > runs runsvdir (with the runit init system)? What starts up whatver
>> > sv script?
>> >
>> > Thanks,
>> >
>> > SteveT
>> >
>> > Steve Litt
>> > January 2017 featured book: Troubleshooting: Just the Facts
>> > http://www.troubleshooters.com/tjust
>>
>>
>>
>



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

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