SIGINT handling in runsvdir

Laurent Bercot ska-dietlibc at skarnet.org
Mon Mar 2 10:16:25 UTC 2015


On 02/03/2015 05:40, Neale Pickett wrote:
> I'm running runsvdir as PID 1

  Hi Neale,
  runsvdir is actually not intended to be run as process 1.
runit's model is to have the "runit" program itself run as process 1,
and it spawns a program for every stage: /etc/runit/{1, 2, 3}.
Traditionally, people use runsvdir in stage 2; when runit gets a
SIGINT, it kills runsvdir then enters stage 3.
  See http://smarden.org/runit/runit.8.html

  I'm not sure how different from upstream the busybox version of
runit is, but they shouldn't be too far apart. The intent in
busybox runit is probably to have runsvdir run under busybox init.

(I believe it was a mistake to integrate runit into busybox in the
first place, because the upstream runit code is small, dependency-free,
and can be statically linked without trouble - it can easily fit on an
embedded box, so making a busybox version of it is a maintenance effort
for not much benefit. But obviously Denys disagrees.)


> Am I intended instead to have PID 1 fork-exec runsvdir, and handle signals, passing them along?

  That is how runit is designed, yes.
  If you want a supervision suite similar to runit but with the ability
to have the equivalent of runsvdir running as process 1, take a look
at s6: http://skarnet.org/software/s6/
and in particular http://skarnet.org/software/s6/s6-svscan-1.html

  Good luck,

-- 
  Laurent



More information about the busybox mailing list