diff options
author | Gerrit Pape <pape@smarden.org> | 2006-03-04 14:14:47 +0000 |
---|---|---|
committer | Gerrit Pape <pape@smarden.org> | 2006-03-04 14:14:47 +0000 |
commit | 5cdc37ab3be9ae7fabfa9077e46b36f3eb913c1c (patch) | |
tree | e7d456fc5f6bca85749141fd5553f57444be5afd | |
parent | a3f1d29c2db2393e2436f1bd928d353f587e2d2a (diff) | |
download | runit-5cdc37ab3be9ae7fabfa9077e46b36f3eb913c1c.tar.gz runit-5cdc37ab3be9ae7fabfa9077e46b36f3eb913c1c.tar.xz runit-5cdc37ab3be9ae7fabfa9077e46b36f3eb913c1c.zip |
* doc/faq.html: new.
* doc/benefits.html: use sv program instead of runsvstat, runsvctrl; minor. * doc/replaceinit.html, doc/runlevels.html: put getty service directory into /etc/sv/. * doc/runscripts.html: use sv program instead of svwaitup. * etc/*/3, etc/macosx/StartupItems/runit: use sv program instead of svwaitdown. * man/runsv.8: use sv program instead of runsvctrl. * man/sv.8: minor. * Makefile, package/commands: no longer build/install runsvctrl, runsvstat, svwaitdown, svwaitup. * man/runsvctrl.8, man/runsvstat.8, man/svwaitdown.8, man/svwaitup.8: remove; obsolete. * doc/index.html: add faq; remove runsvctrl, runsvstat, svwaitdown, svwaitup. * sv.c: fix usage output.
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | doc/benefits.html | 32 | ||||
-rw-r--r-- | doc/faq.html | 387 | ||||
-rw-r--r-- | doc/index.html | 12 | ||||
-rw-r--r-- | doc/install.html | 12 | ||||
-rw-r--r-- | doc/replaceinit.html | 24 | ||||
-rw-r--r-- | doc/runlevels.html | 10 | ||||
-rw-r--r-- | doc/runscripts.html | 10 | ||||
-rwxr-xr-x | etc/debian/3 | 6 | ||||
-rwxr-xr-x | etc/freebsd/3 | 3 | ||||
-rwxr-xr-x | etc/macosx/StartupItems/runit | 3 | ||||
-rwxr-xr-x | etc/openbsd/3 | 6 | ||||
-rw-r--r-- | man/runsv.8 | 4 | ||||
-rw-r--r-- | man/sv.8 | 4 | ||||
-rw-r--r-- | package/CHANGES | 20 | ||||
-rw-r--r-- | package/commands | 4 | ||||
-rwxr-xr-x | package/upgrade | 4 | ||||
-rw-r--r-- | package/versions | 1 | ||||
-rw-r--r-- | src/Makefile | 3 | ||||
-rw-r--r-- | src/sv.c | 4 |
20 files changed, 466 insertions, 85 deletions
diff --git a/Makefile b/Makefile index 5083bc3..866f835 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ DESTDIR= -PACKAGE=runit-1.3.3 +PACKAGE=runit-1.4.0 DIRS=doc man etc package src MANPAGES=runit.8 runit-init.8 runsvdir.8 runsv.8 sv.8 svwaitdown.8 svwaitup.8 \ utmpset.8 runsvchdir.8 runsvstat.8 runsvctrl.8 svlogd.8 chpst.8 diff --git a/doc/benefits.html b/doc/benefits.html index 9940df4..b55d48c 100644 --- a/doc/benefits.html +++ b/doc/benefits.html @@ -17,16 +17,6 @@ <a href="#packaging">Packaging friendly</a><br> <a href="#smallcode">Small code size</a> <hr> -<i>runit</i>'s service supervision concept is heavily based on the -<a href="http://cr.yp.to/daemontools.html">daemontools</a>' one, and mostly -compatible with it. -The benefits described in the -<a href="http://cr.yp.to/daemontools/faq/create.html#why"> -daemontools faq</a> also apply to <i>runit</i>'s service supervision. -Many of the benefits described here also apply to the -<a href="http://cr.yp.to/daemontools.html">daemontools</a> package. -Some are described in both places. -<hr> <a name="supervision"><h3>Service supervision</h3></a> Each service is associated with a <i>service directory</i>, and each service daemon runs as a child process of a supervising @@ -34,23 +24,19 @@ service daemon runs as a child process of a supervising The <a href="runsv.8.html">runsv</a> program provides a reliable interface for signalling the service daemon and controlling the service and supervisor. -Normally the <a href="runsvctrl.8.html">runsvctrl</a> program is used to -send commands through this interface. -The <a href="runsvstat.8.html">runsvstat</a> program can be used to print -status information about the service. +Normally the <a href="sv.8.html">sv</a> program is used to send commands +through this interface, and to query status informations about the service. <p> The <a href="runsv.8.html">runsv</a> program supervises the corresponding service daemon. By default a service is defined to be up, that means, if the service daemon dies, it will be restarted. -Of course you can <a href="runsvctrl.8.html">tell runsv</a> otherwise. +Of course you can <a href="sv.8.html">tell runsv</a> otherwise. <p> -You don't have such a control interface with <i>sysv init</i> for example. -Using the control interface to send signals to the service daemon saves a -lot of extra (non trivial) work to reliably find out the daemon's process -id. -Also <i>sysv init</i> only supports "respawning" of services -started from <tt>inittab</tt>. +This reliable interface to control daemons and supervisors obsolete +pid-guessing programs, such as <tt>pidof</tt>, <tt>killall</tt>, +<tt>start-stop-daemon</tt>, which, due to guessing, are prone to failures +by design. <hr> <a name="state"><h3>Clean process state</h3></a> <i>runit</i> guarantees each service a clean process state, no matter if the @@ -106,9 +92,7 @@ output to write to the pipe. Restarting the service does not require restarting the log service, and vice versa. A good choice for a log daemon is <i>runit</i>'s service logging daemon -<a href="svlogd.8.html">svlogd</a>, or -<a href="http://cr.yp.to/daemontools/multilog.html">multilog</a> from the -<i>daemontools</i> package. +<a href="svlogd.8.html">svlogd</a>. <p> The service daemon and the log daemon can run with different process states, and under different user id's. diff --git a/doc/faq.html b/doc/faq.html new file mode 100644 index 0000000..03d175d --- /dev/null +++ b/doc/faq.html @@ -0,0 +1,387 @@ +<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> +<html> +<head> +<title>runit - Frequently asked questions</title> +</head> +<body> +<a href="http://smarden.org/pape/">G. Pape</a><br> +<a href="index.html">runit</a><br> +<hr> +<h1>runit - Frequently asked questions</h1> +<hr> +<a href="#what"> +What's runit, why is it that different +</a><br> +<a href="#help"> +I need some help with runit, what should I do +</a><br> +<!-- +<a href="#service"> +What is a service, what a service daemon +</a><br> +--> +<a href="#license"> +What's the license, is runit free software +</a><br> +<p> +<a href="#run"> +How do I run a service under runit service supervision +</a><br> +<a href="#create"> +How do I create a new service directory +</a><br> +<!-- +<a href="#log"> +What is a log service +</a><br> +--> +<a href="#createlog"> +How do I create a new service directory with an appendant log service +</a><br> +<a href="#tell"> +How do I tell runit about a new service +</a><br> +<a href="#control"> +How do I start, stop, or restart a service +</a><br> +<a href="#signal"> +How can I send signals to a service daemon +</a><br> +<a href="#status"> +How can I query the status of a service +</a><br> + +<a href="#remove"> +How do I remove a service +</a><br> +<p> +<a href="#depends"> +How do I make a service depend on another service +</a><br> +<!-- +<a href="#strongdepends"> +How can I make a service affect a dependant service +</a><br> +--> +<p> +<a href="#runlevels"> +What about runlevels +</a><br> +<a href="#lsb"> +What about LSB init scripts compliance +</a><br> +<p> +<a href="#readonlyfs"> +Does runit work on a read-only filesystem +</a><br> + +<hr> +<a name="what"><h3> +What's runit, why is it that different +</h3></a> +What is this runit init scheme about? +Why is it that different from sysvinit and other init schemes? +<p> +Answer: +Please see the <a href="index.html">introduction</a>, and web page about +runit's <a href="benefits.html">benefits</a>. + +<hr> +<a name="help"><h3> +I need some help with runit, what should I do +</h3></a> +I have a question, runit is doing something wrong, or I'm doing something +wrong, what should I do? +<p> +Answer: +First see the documentation, especially this list of +<a href="faq.html">frequently asked questions</a>, and the man pages +if you have a question about a specific runit program. +If that still doesn't answer your question, try to search the +<a href="http://news.gmane.org/gmane.comp.sysutils.supervision.general"> +supervision mailing list archive</a>. +Finally, if this fails, feel free to post your question to the +<a href="http://skarnet.org/lists/">supervision mailing list</a>. + +<!-- +<hr> +<a name="service"><h3> +What is a service, what a service daemon +</h3></a> +The runit documentation talks about services and service daemons. +What actually is a service, and what a service daemon? +<p> +Answer: +--> + +<hr> +<a name="license"><h3> +What's the license, is runit free software +</h3></a> +runit is free software, it's licensed under a three-clause BSD alike +license. +See the file <tt>package/COPYING</tt> in the runit tarball. + +<hr> +<a name="run"><h3> +How do I run a service under runit service supervision +</h3></a> +I want a service to be run under runit service supervision, so that it's +automatically started on system boot, and supervised while system uptime. +How does that work? +<p> +Answer: +runit doesn't use the usual <tt>/etc/init.d/</tt> init script interface, +but uses a directory per service. +To integrate a service into the runit init scheme, +<a href="#create">create a service directory</a> for the service, and +<a href="#tell">tell runit</a> about it. + +<hr> +<a name="create"><h3> +How do I create a new service directory +</h3></a> +How do I create a service directory for the use with runit? +<p> +Answer: +Service directories usually are placed into the <tt>/etc/sv/</tt> +directory. +Create a new directory for your service in <tt>/etc/sv/</tt>, put a +<tt>./run</tt> script into it, and make the script executable. +Note that for the use with runit, +<a href="#service">service daemons</a> must not put themself into the +background, but must run in the foreground. +Here's a simple example for a <tt>getty</tt> service: +<pre> + $ cat /etc/sv/getty-2/run + #!/bin/sh + exec getty 38400 tty2 linux + $ +</pre> +Note the <tt>exec</tt> in the last line, it tells the shell that +interprets the script to replace itself with the service daemon +<tt>getty</tt>; this is necessary to make +<a href="#control">controlling the service</a> work properly. + +<hr> +<a name="log"><h3> +What is a log service +</h3></a> +Additionally to supervising a service runit can supervise an appendant +log service. +What does that mean? +<p> +Answer: + + +<hr> +<a name="createlog"><h3> +How do I create a new service directory with an appendant log service +</h3></a> +How do I create a service directory with an appendant log service for the +use with runit? +<p> +Answer: +First <a href="#create">create the service directory</a> for the service. +Then create a subdirectory <tt>./log</tt> in the service directory, again +put a <tt>./run</tt> script into it, and make the script executable. +The <tt>./run</tt> script must run a service logging daemon, normally +this is the <a href="svlogd.8.html">svlogd</a> program. +See the <a href="runsv.8.html">runsv</a> man page for details. +Here's an example of a <tt>./log/run</tt> script: +<pre> + $ cat /etc/sv/socklog-klog/log/run + #!/bin/sh + exec chpst -ulog svlogd -tt ./main + $ +</pre> + +<hr> +<a name="tell"><h3> +How do I tell runit about a new service +</h3></a> +I created a service directory for a service that should run under runit +service supervision. +How do I tell runit about the new service directory, so that it picks +up and runs the service by default? +<p> +Answer: +Create a symbolic link in <tt>/var/service/</tt> pointing to the service +directory, runit will pick up the service within the next five seconds, +and automatically start it on system boot. +E.g.: +<pre> + # ln -s /etc/sv/getty-2 /var/service/ +</pre> + +<hr> +<a name="control"><h3> +How do I start, stop, or restart a service +</h3></a> +I want to stop a service temporarily, and probably restart is later, or +I want to have it restarted immediately. +How can I control a service running under runit service supervision? +<p> +Answer: +Use the <a href="sv.8.html">sv</a> program. +E.g., to restart the <tt>socklog-unix</tt> service, do: +<pre> + # sv restart socklog-unix +</pre> + +<hr> +<a name="signal"><h3> +How can I send signals to a service daemon +</h3></a> +I want to send a service daemon the HUP signal, to have it re-read its +configuration, or I want to send it the INT signal. +How can a send signals to a service daemon? +<p> +Answer: +Use the <a href="sv.8.html">sv</a> program. +E.g., to send the <tt>dhcp</tt> service the HUP signal, do: +<pre> + # sv hup dhcp +</pre> + +<hr> +<a name="status"><h3> +How can I query the status of a service +</a></h3> +I want to now the status of a service, whether it is up and available, +or down as requested, or so. +How can I find out this information? +<p> +Answer: +User the <a href="sv.8.html">sv</a> program. +E.g., to query or check the status of the <tt>socklog-unix</tt> service, +do: +<pre> + # sv status socklog-unix +</pre> +or +<pre> + # sv check socklog-unix +</pre> + +<hr> +<a name="remove"><h3> +How do I remove a service +</h3></a> +I want to remove a service that currently runs under runit service +supervision. +How do I tell runit? +<p> +Answer: +Remove the symbolic link in <tt>/var/service/</tt> pointing to the service +directory, runit recognizes the removed service within the next five +seconds, then stops the service, the optional log service, and finally the +supervisor process. +E.g.: +<pre> + # rm /var/service/getty-2 +</pre> + +<hr> +<a name="depends"><h3> +How do I make a service depend on another service +</a></h3> +I have a service that needs another service to be available before it can +start. +How can I tell runit about this dependency? +<p> +Answer: +Make sure in the <tt>./run</tt> script of the dependant service that the +service it depends on is available before the service daemon starts. +The <a href="sv.8.html">sv</a> program can be used for that. +E.g. the <tt>cron</tt> service wants the <tt>socklog-unix</tt> system +logging service to be available before starting the <tt>cron</tt> service +daemon, so no logs get lost: +<pre> + $ cat /etc/sv/cron/run + #!/bin/sh + sv start socklog-unix || exit 1 + exec cron -f + $ +</pre> +See also the <a href="dependencies.html">documentation</a>. + +<!-- +<hr> +<a name="strongdepends"><h3> +How can I make a service affect a dependant service +</a></h3> +<a href="#depends">This dependency</a> is not enough. +I have a service that needs to be stopped or restarted, whenever a service +it depends on stops or restarts. +How can I tell runit about that a service affects a dependant service in +such a way? +<p> +Answer: +First think about whether you really need this, it almost never should be +necessary. +If you really need this, +--> + +<hr> +<a name="runlevels"><h3> +What about runlevels +</a></h3> +Other init schemes support runlevels, what about runit? +<p> +Answer: +runit support runlevels, even more flexible than traditional init schemes. +See <a href="runlevels.html">the documentation</a>. + +<hr> +<a name="lsb"><h3> +What about LSB init scripts compliance +</a></h3> +I know about the <a href="sv.8.html">sv</a> program to control a service, +but have applications that rely on the <tt>/etc/init.d/</tt> scripts +interface as defined in the LSB. +Do I need to change the application to work with runit? +<p> +Answer: +The <a href="sv.8.html">sv</a> program supports the <tt>/etc/init.d/</tt> +script interface +<a href="http://refspecs.freestandards.org/LSB_2.1.0/LSB-generic/LSB-generic/iniscrptact.html"> +as defined through LSB</a>. +To make this script interface work for a service, create a symbolic link +in <tt>/etc/init.d/</tt>, named as the service daemon, pointing to the +<a href="sv.8.html">sv</a> program, e.g. for the <tt>cron</tt> service: +<pre> + # ln -s /bin/sv /etc/init.d/cron + # /etc/init.d/cron restart + ok: run: cron: (pid 5869) 0s + # +</pre> + +<hr> +<a name="readonlyfs"><h3> +Does runit work on a read-only filesystem +</a></h3> +On my system <tt>/etc/</tt> is mounted read-only by default. +runit uses many files in <tt>/etc/</tt> it need to write to, like +<tt>/etc/runit/stopit</tt>, and the <tt>./supervise/</tt> +subdirectories in the service directories. +How can I make runit work on my system? +<p> +Answer: +Use symbolic links, runit deals with them well, even with dangling +symlinks. +E.g., make a ramdisk available at a moint point, say <tt>/var/run/</tt>, +and create symbolic links for the files and directories that runit needs +to write access to pointing into <tt>/var/run/</tt>: +<pre> + # ln -s /var/run/runit.stopit /etc/runit/stopit + # ln -s /var/run/sv.getty-2 /etc/sv/getty-2/supervise +</pre> + +<hr> +<address><a href="mailto:pape@smarden.org"> +Gerrit Pape <pape@smarden.org> +</a></address> +<small>$Id$</small> +</body> +</html> diff --git a/doc/index.html b/doc/index.html index e1178e4..ec1523d 100644 --- a/doc/index.html +++ b/doc/index.html @@ -18,7 +18,8 @@ release 1.0.x of <i>runit</i>. <a href="benefits.html">Benefits</a><br> <a href="replaceinit.html">How to replace init</a><br> <a href="useinit.html">How to use runit with current init</a><br> -<a href="usedietlibc.html">How to use dietlibc</a> +<a href="usedietlibc.html">How to use dietlibc</a><br> +<a href="faq.html">Frequently asked questions</a><br> <p> <a href="runlevels.html">Runlevels</a><br> <a href="dependencies.html">Service dependencies</a><br> @@ -27,19 +28,14 @@ release 1.0.x of <i>runit</i>. <a href="runit.8.html">The <tt>runit</tt> program</a><br> <a href="runit-init.8.html">The <tt>runit-init</tt> program</a><br> <br> +<a href="sv.8.html">The <tt>sv</tt> program</a><br> +<br> <a href="runsvdir.8.html">The <tt>runsvdir</tt> program</a><br> <a href="runsvchdir.8.html">The <tt>runsvchdir</tt> program</a><br> <a href="runsv.8.html">The <tt>runsv</tt> program</a><br> -<a href="runsvstat.8.html">The <tt>runsvstat</tt> program</a><br> -<a href="runsvctrl.8.html">The <tt>runsvctrl</tt> program</a><br> -<br> -<a href="sv.8.html">The <tt>sv</tt> program</a><br> <br> <a href="svlogd.8.html">The <tt>svlogd</tt> program</a><br> <br> -<a href="svwaitdown.8.html">The <tt>svwaitdown</tt> program</a><br> -<a href="svwaitup.8.html">The <tt>svwaitup</tt> program</a><br> -<br> <a href="chpst.8.html">The <tt>chpst</tt> program</a><br> <a href="utmpset.8.html">The <tt>utmpset</tt> program</a><br> <hr> diff --git a/doc/install.html b/doc/install.html index 8140e6c..a589c34 100644 --- a/doc/install.html +++ b/doc/install.html @@ -17,14 +17,14 @@ If you don't have a <tt>/package</tt> directory, create it now: # chmod 1755 /package </pre> Download -<a href="runit-1.3.3.tar.gz">runit-1.3.3.tar.gz</a> into <tt>/package</tt> +<a href="runit-1.4.0.tar.gz">runit-1.4.0.tar.gz</a> into <tt>/package</tt> and unpack the archive <pre> # cd /package - # gunzip runit-1.3.3.tar - # tar -xpf runit-1.3.3.tar - # rm runit-1.3.3.tar - # cd admin/runit-1.3.3 + # gunzip runit-1.4.0.tar + # tar -xpf runit-1.4.0.tar + # rm runit-1.4.0.tar + # cd admin/runit-1.4.0 </pre> On MacOSX, do <pre> @@ -43,7 +43,7 @@ hierarchy, do: </pre> To report success: <pre> - # mail pape-runit-1.3.3@smarden.org <compile/sysdeps + # mail pape-runit-1.4.0@smarden.org <compile/sysdeps </pre> If you use <i>runit</i> regularly, please <a href="http://smarden.org/pape/#contribution">contribute</a> to the project. diff --git a/doc/replaceinit.html b/doc/replaceinit.html index 408897e..f5bd40f 100644 --- a/doc/replaceinit.html +++ b/doc/replaceinit.html @@ -31,9 +31,9 @@ If you have installed the precompiled Debian package, start at step 3. </pre> Create also a getty service directory: <pre> - # mkdir -p /etc/runit/getty-5 - # cp -p /package/admin/runit/etc/debian/getty-tty5/run /etc/runit/getty-5/ - # cp -p /package/admin/runit/etc/debian/getty-tty5/finish /etc/runit/getty-5/ + # mkdir -p /etc/sv/getty-5 + # cp -p /package/admin/runit/etc/debian/getty-tty5/run /etc/sv/getty-5/ + # cp -p /package/admin/runit/etc/debian/getty-tty5/finish /etc/sv/getty-5/ </pre> If you want <i>runit</i> to handle the ctrl-alt-del keyboard request, do: <pre> @@ -53,7 +53,7 @@ needed), and tell <a href="runsvdir.8.html">runsvdir</a> about the getty-5 <i>service</i>: <pre> # mkdir -p /var/service - # ln -s /etc/runit/getty-5 /var/service/ + # ln -s /etc/sv/getty-5 /var/service/ </pre> Start <i>runit</i>'s stage 2 for testing: <pre> @@ -116,7 +116,7 @@ default Unix process no 1 <i>runit</i>. </pre> To report success: <pre> - # ( uname -a ; cat /etc/runit/[123] ) |mail pape-runit-1.3.3@smarden.org + # ( uname -a ; cat /etc/runit/[123] ) |mail pape-runit-1.4.0@smarden.org </pre> <hr> @@ -158,21 +158,21 @@ At least one getty must run in stage 2 so that you are able to login. To have it run on the virtual console no 5, create the getty-5 service directory: <pre> - # mkdir -p /etc/runit/getty-5 + # mkdir -p /etc/sv/getty-5 OpenBSD 2.9: - # cp -p /package/admin/runit/etc/openbsd/getty-ttyC4/run /etc/runit/getty-5/ - # cp -p /package/admin/runit/etc/openbsd/getty-ttyC4/finish /etc/runit/getty-5/ + # cp -p /package/admin/runit/etc/openbsd/getty-ttyC4/run /etc/sv/getty-5/ + # cp -p /package/admin/runit/etc/openbsd/getty-ttyC4/finish /etc/sv/getty-5/ FreeBSD 4.4: - # cp -p /package/admin/runit/etc/freebsd/getty-ttyv4/run /etc/runit/getty-5/ - # cp -p /package/admin/runit/etc/freebsd/getty-ttyv4/finish /etc/runit/getty-5/ + # cp -p /package/admin/runit/etc/freebsd/getty-ttyv4/run /etc/sv/getty-5/ + # cp -p /package/admin/runit/etc/freebsd/getty-ttyv4/finish /etc/sv/getty-5/ </pre> and tell <a href="runsvdir.8.html">runsvdir</a> about the <tt>getty-5</tt> <i>service</i>: <pre> # mkdir -p /var/service - # ln -s /etc/runit/getty-5 /var/service/ + # ln -s /etc/sv/getty-5 /var/service/ </pre> Start <i>runit</i>'s stage 2 for testing: <pre> @@ -205,7 +205,7 @@ This will cause <i>runit</i> to enter stage 3 which runs <p> To report success: <pre> - # ( uname -a ; cat /etc/runit/[123] ) |mail pape-runit-1.3.3@smarden.org + # ( uname -a ; cat /etc/runit/[123] ) |mail pape-runit-1.4.0@smarden.org </pre> <h3>Step 5: Service migration</h3> The goal is to migrate all services from <i>/etc/rc.*</i> scheme to the diff --git a/doc/runlevels.html b/doc/runlevels.html index e3cf11d..eb68113 100644 --- a/doc/runlevels.html +++ b/doc/runlevels.html @@ -22,7 +22,7 @@ Create the following directories and symbolic links: <pre> # mkdir -p /etc/runit/runsvdir/default # mkdir -p /etc/runit/runsvdir/single - # ln -s /etc/runit/getty-5 /etc/runit/runsvdir/single/getty-5 + # ln -s /etc/sv/getty-5 /etc/runit/runsvdir/single/ # ln -s default /etc/runit/runsvdir/current </pre> Copy the contents of <tt>/var/service/</tt> to @@ -72,7 +72,7 @@ You can check the status of the <tt>previous</tt> runlevel through <hr> <a name="create"><h3>Creating new runlevels</h3></a> To create a new runlevel, simply create a new directory in -<tt>/etc/runit/runsvdir</tt>. +<tt>/etc/runit/runsvdir/</tt>. The name of the directory is the name of the new runlevel. The name must not start with a dot and must not be <tt>current</tt>, <tt>current.new</tt>, or <tt>previous</tt>, e.g.: @@ -82,9 +82,9 @@ The name must not start with a dot and must not be <tt>current</tt>, Add the services you want to run in the runlevel <tt>maintenance</tt> to the newly created directory, e.g.: <pre> - # ln -s /etc/runit/getty-5 /etc/runit/runsvdir/maintenance/ - # ln -s /etc/runit/runsv/ssh /etc/runit/runsvdir/maintenance/ - # ln -s /etc/runit/runsv/dnscache /etc/runit/runsvdir/maintenance/ + # ln -s /etc/sv/getty-5 /etc/runit/runsvdir/maintenance/ + # ln -s /etc/sv/ssh /etc/runit/runsvdir/maintenance/ + # ln -s /etc/sv/dnscache /etc/runit/runsvdir/maintenance/ </pre> If you want to switch to the runlevel <tt>maintenance</tt>, do: <pre> diff --git a/doc/runscripts.html b/doc/runscripts.html index 000f7b0..3e52814 100644 --- a/doc/runscripts.html +++ b/doc/runscripts.html @@ -201,7 +201,7 @@ logging console messages</a><br> test -n "$CFS_MOUNT" || exit 0 test -n "$CFS_UMOUNT" || exit 0 - svwaitup -s 2 /var/service/portmap + sv start portmap || exit 1 exec env \ NODAEMON=1 CFS_MOUNT="$CFS_MOUNT" CFS_UMOUNT="$CFS_UMOUNT" $DAEMON @@ -379,7 +379,7 @@ to be set up. <pre> #!/bin/sh exec 2>&1 - svwaitup -s 2 /var/service/portmap + sv start /var/service/portmap || exit 1 exec famd -T 0 -f </pre> <hr> @@ -515,7 +515,7 @@ to be set up. (<i>Debian sid</i>, <i>FreeBSD 5.3-REL</i>) <pre> #!/bin/sh - svwaitup -s 2 /service/getty-* + sv start /service/getty-* || exit 1 exec kdm -nodaemon </pre> <hr> @@ -865,7 +865,7 @@ to be set up. (<i>Debian</i>) <pre> #!/bin/sh -svwaitup /var/service/statd +sv start portmap statd || exit 1 RPCNFSDCOUNT=8 # Number of servers to be started up by default RPCMOUNTDOPTS= @@ -964,7 +964,7 @@ to be set up. (<i>Linux</i>) <pre> #!/bin/sh - svwaitup -s 2 /service/vc-* + sv start /service/vc-* || exit 1 exec xdm -nodaemon </pre> <hr> diff --git a/etc/debian/3 b/etc/debian/3 index e014e13..5931ce6 100755 --- a/etc/debian/3 +++ b/etc/debian/3 @@ -6,11 +6,9 @@ PATH=/command:/sbin:/bin:/usr/sbin:/usr/bin LAST=0 test -x /etc/runit/reboot && LAST=6 -echo 'Waiting for getties to stop...' -svwaitdown -xk -t14 /var/service/getty-* - echo 'Waiting for services to stop...' -svwaitdown -xk -t350 /var/service/* +sv -w196 force-stop /var/service/* +sv exit /var/service/* echo 'Shutdown...' /etc/init.d/rc $LAST diff --git a/etc/freebsd/3 b/etc/freebsd/3 index b04f4af..c30bdb1 100755 --- a/etc/freebsd/3 +++ b/etc/freebsd/3 @@ -4,7 +4,8 @@ exec 2>&1 PATH=/command:/sbin:/bin:/usr/sbin:/usr/bin echo 'Waiting for services to stop...' -svwaitdown -xk -t350 /var/service/* +sv -w196 force-stop /var/service/* +sv exit /var/service/* echo 'Shutdown...' if test -x /etc/runit/reboot; then diff --git a/etc/macosx/StartupItems/runit b/etc/macosx/StartupItems/runit index 916d769..6b4f0c4 100755 --- a/etc/macosx/StartupItems/runit +++ b/etc/macosx/StartupItems/runit @@ -12,7 +12,8 @@ StartService() { } StopService() { ConsoleMessage "Stopping runit service supervision" - svwaitdown -xk -t14 /var/service/* + sv -w196 force-stop /var/service/* + sv exit /var/service/* } RestartService() { return 0 diff --git a/etc/openbsd/3 b/etc/openbsd/3 index b868031..c30bdb1 100755 --- a/etc/openbsd/3 +++ b/etc/openbsd/3 @@ -3,11 +3,9 @@ exec 2>&1 PATH=/command:/sbin:/bin:/usr/sbin:/usr/bin -echo 'Waiting for getties to stop...' -svwaitdown -xk -t14 /var/service/getty-* - echo 'Waiting for services to stop...' -svwaitdown -xk -t350 /var/service/* +sv -w196 force-stop /var/service/* +sv exit /var/service/* echo 'Shutdown...' if test -x /etc/runit/reboot; then diff --git a/man/runsv.8 b/man/runsv.8 index aebbc45..81048fb 100644 --- a/man/runsv.8 +++ b/man/runsv.8 @@ -69,7 +69,7 @@ and (optionally) are provided to give commands to .BR runsv . You can use -.BR runsvctrl (8) +.BR sv (8) to control the service or just write one of the following characters to the named pipe: .TP @@ -146,7 +146,7 @@ This command is ignored if it is given to .IR service /log/supervise/control. .P Example: to send a TERM signal to the socklog-unix service, either do - # runsvctrl term /var/service/socklog-unix + # sv term /var/service/socklog-unix or # echo \-n t >/var/service/socklog-unix/supervise/control .P diff --git a/man/sv.8 b/man/sv.8 index 59be1dc..3d538c0 100644 --- a/man/sv.8 +++ b/man/sv.8 @@ -85,7 +85,7 @@ This command is ignored if it is given to an appendant log service. .BR sv actually looks only at the first character of these .IR command s. -.SH Commands compatible to LSB init script actions +.SS Commands compatible to LSB init script actions .TP .B status Same as @@ -182,7 +182,7 @@ process to terminate. Then report the status, and on timeout send the service the .I kill command. -.SH Additional Commands +.SS Additional Commands .TP .B check Check for the service to be in the state that's been requested. diff --git a/package/CHANGES b/package/CHANGES index ff504ab..e5e593d 100644 --- a/package/CHANGES +++ b/package/CHANGES @@ -1,3 +1,23 @@ +runit 1.4.0 +Sat, 04 Mar 2006 14:13:49 +0000 + * doc/faq.html: new. + * doc/benefits.html: use sv program instead of runsvstat, runsvctrl; + minor. + * doc/replaceinit.html, doc/runlevels.html: put getty service directory + into /etc/sv/. + * doc/runscripts.html: use sv program instead of svwaitup. + * etc/*/3, etc/macosx/StartupItems/runit: use sv program instead of + svwaitdown. + * man/runsv.8: use sv program instead of runsvctrl. + * man/sv.8: minor. + * Makefile, package/commands: no longer build/install runsvctrl, + runsvstat, svwaitdown, svwaitup. + * man/runsvctrl.8, man/runsvstat.8, man/svwaitdown.8, man/svwaitup.8: + remove; obsolete. + * doc/index.html: add faq; remove runsvctrl, runsvstat, svwaitdown, + svwaitup. + * sv.c: fix usage output. + runit 1.3.3 Mon, 02 Jan 2006 20:35:34 +0000 * chpst.c: adjust nice value and set limits before dropping permissions. diff --git a/package/commands b/package/commands index c862949..043d245 100644 --- a/package/commands +++ b/package/commands @@ -3,11 +3,7 @@ runit runit-init runsv runsvchdir -runsvctrl runsvdir -runsvstat sv svlogd -svwaitdown -svwaitup utmpset diff --git a/package/upgrade b/package/upgrade index 7092a2e..902e571 100755 --- a/package/upgrade +++ b/package/upgrade @@ -8,9 +8,9 @@ test -d src || sh -cx '! : Wrong working directory.' here=`env - PATH=$PATH pwd` parent=`dirname $here` -echo 'Creating symlink runit -> runit-1.3.3...' +echo 'Creating symlink runit -> runit-1.4.0...' rm -f runit -ln -s runit-1.3.3 runit +ln -s runit-1.4.0 runit mv -f runit .. echo 'Making command links in /command...' diff --git a/package/versions b/package/versions index 91fb519..166a4e7 100644 --- a/package/versions +++ b/package/versions @@ -38,3 +38,4 @@ 1.3.1 1.3.2 1.3.3 +1.4.0 diff --git a/src/Makefile b/src/Makefile index b425fa8..d9624de 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,5 +1,4 @@ -IT=chpst runit runit-init runsv runsvchdir runsvctrl runsvdir runsvstat sv \ - svlogd svwaitdown svwaitup utmpset +IT=chpst runit runit-init runsv runsvchdir runsvdir sv svlogd utmpset default: sysdeps $(IT) diff --git a/src/sv.c b/src/sv.c index cae9a78..ce5bef5 100644 --- a/src/sv.c +++ b/src/sv.c @@ -14,8 +14,8 @@ #include "taia.h" #include "wait.h" -#define USAGE " [-v] [-w sec] action service ..." -#define USAGELSB " [-w sec] action" +#define USAGE " [-v] [-w sec] command service ..." +#define USAGELSB " [-w sec] command" #define VERSION "$Id$" |