supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
From: Bernhard Graf <list-supervision@augensalat.de>
To: supervision@list.skarnet.org
Subject: Re: using runit as init
Date: Thu, 10 Jan 2008 10:20:51 +0100	[thread overview]
Message-ID: <200801101020.51580.list-supervision@augensalat.de> (raw)
In-Reply-To: <200801091634.06623.mike@geekgene.com>

On Thursday 10 January 2008 00:34, Mike Buland wrote:
> Regaurding service dependancies, Richard Gooch's method is actually
> unnecesarry in a sytem such as runit, and service dependancy is
> already handled in an almost identicle way, but with less system
> overhead.
>
> At the begining of a run script just start the services you depend
> on, and exit if the sv command returns non-zero.  I.e. from hal's run
> script: sv start /etc/service/dbus || exit 1

I tend to object:

You mean starting a bunch of programs over and over again, because many
of them quit immediatly is less system overhead than starting programs
that pause until those programs they depend on are started?

Also imagine one service A that depends on service B, C and D. You have
to put the checks for availability of B, C, D into A's run script.
In a complex system more services depend on B, C and D and probably
others. You have to put the same checks (and others) in all those
services. Also those checks tend to be more complicated than just saying
"need B C D".

> As far as running SysV init style scripts, usually handled on modern
> linux systems (redhat, slackware, debian, etc) by the master rc
> script, are you suggesting that rc, to control runlevel changes be
> placed in it's own service, or that each SysV "service" gets it's own
> runit service?

The latter.

> If you're referring to the later case, you'll need to do a lot more
> work to synchronize the rc scripts and the runit services, I can't
> imagine how just making symlinks between the init.d runlevel
> directories and runsvdir service directories will actually work.

In current distributions (hopefully) an init.d script is configured
using a program that sets the appropriate symlinks. The information for
run levels and dependencies are taken from the init scripts [5], [6].

If you'd replace init by runit, you had to replace those installtion
programs as well.

This installer would install the example from [5] as:

# ls -l /etc/runit/sv/lsb-ourdb
-rw-------   1 root root      0 Jan 10 09:00 initd
-rw-------   1 root root     30 Jan 10 09:00 need
lrwxrwxrwx   1 root root     19 Jan 10 09:00 run -> /etc/init.d/lsb-ourdb
# cat /etc/runit/sv/lsb-ourdb/need
$local_fs
$network
$remote_fs
# ls -l /etc/runit/runsvdir/2/lsb-ourdb
lrwxrwxrwx   1 root root     19 Jan 10 09:00 /etc/runit/runsvdir/2/lsb-ourdb -> /etc/runit/sv/lsb-ourdb
# ls -l /etc/runit/runsvdir/3/lsb-ourdb
lrwxrwxrwx   1 root root     19 Jan 10 09:00 /etc/runit/runsvdir/3/lsb-ourdb -> /etc/runit/sv/lsb-ourdb
# ls -l /etc/runit/runsvdir/4/lsb-ourdb
lrwxrwxrwx   1 root root     19 Jan 10 09:00 /etc/runit/runsvdir/4/lsb-ourdb -> /etc/runit/sv/lsb-ourdb
# ls -l /etc/runit/runsvdir/5/lsb-ourdb
lrwxrwxrwx   1 root root     19 Jan 10 09:00 /etc/runit/runsvdir/5/lsb-ourdb -> /etc/runit/sv/lsb-ourdb

File initd is a flag for runit to run the script with argument "start"
first, then wait for SIGINT and run the script with argument "stop".

File need contains services that runit has to be started first.
"$service" for "meta services" as set with "provide" in Gooch's concept.

> Finally, if you really do want to start an rc script and make it
> appear as though it were a normal runit system service, then I would
> reccomend starting it in a run script, then executing a command that
> blocks forever.  The service will use effectively no CPU time, but
> will stay running, forever. Then you can call the corrisponding rc 6
> or whatever you want in the finish script of the service.

I will try this, and see how far I get...


[5] http://refspecs.linux-foundation.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/initscrcomconv.html
[6] http://refspecs.linux-foundation.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/initsrcinstrm.html

-- 
Bernhard Graf


  parent reply	other threads:[~2008-01-10  9:20 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-03 20:51 Bernhard Graf
2008-01-04  0:22 ` Mike Buland
2008-01-05  0:06   ` Bernhard Graf
     [not found]   ` <12EC84FDD73F4BD8A78E7501EB19F1E2@home.internal>
2008-01-05  7:45     ` rehan khan
2008-01-05 23:17       ` Bernhard Graf
2008-01-08  7:11         ` Vincent Danen
2008-01-08 22:28           ` Bernhard Graf
2008-01-09  2:05             ` Vincent Danen
2008-01-09 23:06               ` Bernhard Graf
2008-01-09 23:34                 ` Mike Buland
2008-01-09 23:51                   ` Charlie Brady
2008-01-10  9:22                     ` Bernhard Graf
2008-01-10  9:20                   ` Bernhard Graf [this message]
2008-01-10 20:06                     ` Mike Buland
2008-01-11  7:58                       ` Bernhard Graf
2008-01-11 14:30                         ` Mike Buland
2008-01-12 10:18                           ` Bernhard Graf
2008-01-12 17:13                             ` supervising (Re: using runit as init) Charlie Brady
2008-01-12 17:32                               ` supervising mysql (Re: supervising (Re: using runit as init)) Charlie Brady
2008-01-13  4:40                             ` using runit as init Vincent Danen
2008-01-13 15:36                               ` Charlie Brady
2008-01-13 18:28                                 ` Mike Buland
2008-01-13 18:39                                   ` Charlie Brady
2008-01-13 18:49                                     ` Mike Buland
2008-01-14  3:55                                       ` Vincent Danen
2008-01-14 15:11                                         ` Charlie Brady
2008-01-14 15:21                                           ` Vincent Danen
     [not found]                                     ` <6A64B0D384404190ACB76E0A376CD148@home.internal>
2008-01-13 21:06                                       ` rehan khan
2008-01-14  3:53                                 ` Vincent Danen
     [not found]                             ` <CDFFB8AF013F4762AE02CF6A1BDCB27A@home.internal>
2008-01-13 10:35                               ` rehan khan
2008-01-14  3:50                                 ` Vincent Danen
2008-01-13 18:52                             ` Mike Buland
     [not found]                     ` <85040AD9CA634253A8FDB9F7DA6BD200@home.internal>
2008-01-10 22:08                       ` rehan khan
2008-01-11  1:28                         ` Charlie Brady
     [not found]                   ` <C1A5323F485E4A75B75ADB58B664E35E@home.internal>
2008-01-10 21:56                     ` rehan khan
2008-01-09 23:35                 ` KORN Andras
2008-01-10  8:39                   ` Bernhard Graf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200801101020.51580.list-supervision@augensalat.de \
    --to=list-supervision@augensalat.de \
    --cc=supervision@list.skarnet.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).