Jared Rhine
2004-09-16 19:13:50 UTC
Are there any known caveats to "nesting" runsvdir instances? I'm
having problems with signals and processes reparenting to init.
By nested I mean that an init-started "main" runsvdir has one service
which has a run script of:
-- begin --
#!/bin/sh
exec 2>&1
exec chpst -P -u monitor -e /var/di/monitor/runit/envdir runsvdir -P /var/di/monitor/runit/services 'log: ..........'
-- end --
(Yes, I am running the runsvdir -P patch recently sent by Gerrit; I
get the same behavior without the patch but I thought I should check
to see if it made a difference. I've tried various combinations of
pgrp switches without effect.) There are a couple of services defined
under /var/di/monitor/runit/services (call them "router" and
"archiver"). I can start/stop/manipulate these services fine using
runsvctrl.
But if I terminate the "parent" service (via runsvctrl down for
instance), the router and archiver runsv processes don't die; they
instead move to a parent pid of 1. I can then runsvctrl the router
and archiver services fine. But this is a bad situation to put the
server in and worse case (except I'm using chpst -L lockfiles), I get
multiple daemons running. I expect that killing the nested runsvdir
should kill all its child services.
runit is probably doing the expected thing given what I'm thrown at
it, but I don't know what misconfiguration I've done. I didn't think
this configuration would cause any unusual issues (Solaris 9/sparc) as
the mechanics of signals/waitpid/etc instead a "nested" runsvdir
should be about the same, right?
Suggestions or snippets of working "nested" runsvdir configurations
would be most appreciated.
-- ***@wordzoo.com
"A pessimist is one who has been intimately acquainted with an optimist."
-- Elbert Hubbard
having problems with signals and processes reparenting to init.
By nested I mean that an init-started "main" runsvdir has one service
which has a run script of:
-- begin --
#!/bin/sh
exec 2>&1
exec chpst -P -u monitor -e /var/di/monitor/runit/envdir runsvdir -P /var/di/monitor/runit/services 'log: ..........'
-- end --
(Yes, I am running the runsvdir -P patch recently sent by Gerrit; I
get the same behavior without the patch but I thought I should check
to see if it made a difference. I've tried various combinations of
pgrp switches without effect.) There are a couple of services defined
under /var/di/monitor/runit/services (call them "router" and
"archiver"). I can start/stop/manipulate these services fine using
runsvctrl.
But if I terminate the "parent" service (via runsvctrl down for
instance), the router and archiver runsv processes don't die; they
instead move to a parent pid of 1. I can then runsvctrl the router
and archiver services fine. But this is a bad situation to put the
server in and worse case (except I'm using chpst -L lockfiles), I get
multiple daemons running. I expect that killing the nested runsvdir
should kill all its child services.
runit is probably doing the expected thing given what I'm thrown at
it, but I don't know what misconfiguration I've done. I didn't think
this configuration would cause any unusual issues (Solaris 9/sparc) as
the mechanics of signals/waitpid/etc instead a "nested" runsvdir
should be about the same, right?
Suggestions or snippets of working "nested" runsvdir configurations
would be most appreciated.
-- ***@wordzoo.com
"A pessimist is one who has been intimately acquainted with an optimist."
-- Elbert Hubbard