commit ed16e96cf504a96fc37fb6d2e586185deef1d2e4
parent 929d65f018a3e269ce80493795dcbb2a8ca49a86
Author: Gerrit Pape <pape@smarden.org>
Date: Wed, 25 Sep 2002 10:17:58 +0000
new.
Diffstat:
A | doc/runsv.8.html | | | 128 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
A | doc/runsvdir.8.html | | | 55 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
A | man/runsv.8 | | | 149 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
A | man/runsvdir.8 | | | 83 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
4 files changed, 415 insertions(+), 0 deletions(-)
diff --git a/doc/runsv.8.html b/doc/runsv.8.html
@@ -0,0 +1,128 @@
+
+
+
+<HTML>
+<HEAD>
+<TITLE>runsv(8) manual page</TITLE>
+</HEAD>
+<BODY bgcolor=white>
+<a href="http://smarden.org/pape/">G. Pape</a><br><A HREF="index.html">runit</A><hr><P>
+
+<H2><A NAME="sect0">Name</A></H2>
+runsv - starts and monitors a service and optionally an appendant log
+service
+<H2><A NAME="sect1">Synopsis</A></H2>
+<B>runsv</B> <I>service</I>
+<H2><A NAME="sect2">Description</A></H2>
+<I>service</I> must be a directory. <P>
+<B>runsv</B>
+switches to the directory <I>service</I> and starts ./run. if ./run exits and ./finish
+exists, <B>runsv</B> starts ./finish. If ./finish doesn't exist or ./finish exits,
+<B>runsv</B> restarts ./run. <P>
+If ./run or ./finish exit immediatly, <B>runsv</B> waits a second
+before starting ./finish or restarting ./run. <P>
+If the file <I>service</I>/down exists,
+<B>runsv</B> does not start ./run immediately. The control interface (see below)
+can be used to start the service and to give other commands to <B>runsv</B>. <P>
+If
+the directory <I>service</I>/log exists, <B>runsv</B> creates a pipe, redirects <I>service</I>/run's
+and <I>service</I>/finish's standard output to the pipe, switches to the directory
+<I>service</I>/log and starts ./run (and ./finish) exactly as described above for
+the <I>service</I> directory. The standard input of the log service a redirected
+to read from the pipe. <P>
+<B>runsv</B> maintains status information in a binary format
+compatible to <B><I>supervise</B>(8)</I> in <I>service</I>/supervise/status ( and <I>service</I>/log/supervise/status),
+and in a human readable format in <I>service</I>/supervise/stat ( and <I>service</I>/log/supervise/stat).
+
+<H2><A NAME="sect3">Control</A></H2>
+The named pipe <I>service</I>/supervise/control (and <I>service</I>/log/supervise/control)
+is provided to give commands to <B>runsv</B>. You can use <B><I>svc</B>(8)</I> to control the
+service or just write one of the following characters to the named pipe:
+
+<DL>
+
+<DT><B>u</B> </DT>
+<DD>Up. If the service is not running, start it. If the service stops, restart
+it. </DD>
+
+<DT><B>d</B> </DT>
+<DD>Down. If the service is running, send it a TERM signal. If ./run exits,
+start ./finish if it exists. After it stops, do not restart service. </DD>
+
+<DT><B>o</B> </DT>
+<DD>Once.
+If the service is not running, start it. Do not restart it if it stops. </DD>
+
+<DT><B>p</B>
+</DT>
+<DD>Pause. If the service is running, send it a STOP signal. </DD>
+
+<DT><B>c</B> </DT>
+<DD>Continue. If the
+service is running, send it a CONT signal. </DD>
+
+<DT><B>h</B> </DT>
+<DD>Hangup. If the service is running,
+send it a HUP signal. </DD>
+
+<DT><B>a</B> </DT>
+<DD>Alarm. If the service is running, send it a ALRM
+signal. </DD>
+
+<DT><B>i</B> </DT>
+<DD>Interrupt. If the service is running, send it a INT signal. </LI><B></B><LI>User-defined
+1. If the service is running, send it a USR1 signal. </LI><B></B><LI>User-defined 2. If the
+service is running, send it a USR2 signal. </DD>
+
+<DT><B>t</B> </DT>
+<DD>Terminate. If the service is
+running, send it a TERM signal. </DD>
+
+<DT><B>k</B> </DT>
+<DD>Kill. If the service is running, send it
+a KILL signal. </DD>
+
+<DT><B>x or <B>e</B> </B></DT>
+<DD>Exit. If the service is running, send it a TERM signal.
+Do not restart the service. If the service is down, and no log service exists,
+<B>runsv</B> exits. If the service is down and a log service exists, send a TERM
+signal to the log service. If the log service is down, <B>runsv</B> exits. This
+command is ignored if it is given to <I>service</I>/log/supervise/control. </DD>
+</DL>
+<P>
+For
+example, to send a TERM signal to /service/socklog-unix, either do # svc
+-t /service/socklog-unix<BR>
+ or<BR>
+ # echo -n t >/service/socklog-unix/supervise/control<BR>
+
+<H2><A NAME="sect4">Signals</A></H2>
+If <B>runsv</B> receives a TERM signal, it acts as if the character x
+was written to the control pipe.
+<H2><A NAME="sect5">Exit Codes</A></H2>
+<B>runsv</B> exits 111 on an error on
+startup or if another <B>runsv</B> is running in <I>service</I>. <P>
+<B>runsv</B> exits 0 if it was
+told to exit.
+<H2><A NAME="sect6">See Also</A></H2>
+<I>runit(8)</I>, <I>runit-init(8)</I>, <I>runsvdir(8)</I>, <I>svc(8)</I>, <I>supervise(8)</I>
+<P>
+ <I>http://smarden.org/runit/</I><BR>
+ <I>http://cr.yp.to/daemontools.html</I><BR>
+
+<H2><A NAME="sect7">Author</A></H2>
+Gerrit Pape <pape@smarden.org> <P>
+
+<HR><P>
+<A NAME="toc"><B>Table of Contents</B></A><P>
+<UL>
+<LI><A NAME="toc0" HREF="#sect0">Name</A></LI>
+<LI><A NAME="toc1" HREF="#sect1">Synopsis</A></LI>
+<LI><A NAME="toc2" HREF="#sect2">Description</A></LI>
+<LI><A NAME="toc3" HREF="#sect3">Control</A></LI>
+<LI><A NAME="toc4" HREF="#sect4">Signals</A></LI>
+<LI><A NAME="toc5" HREF="#sect5">Exit Codes</A></LI>
+<LI><A NAME="toc6" HREF="#sect6">See Also</A></LI>
+<LI><A NAME="toc7" HREF="#sect7">Author</A></LI>
+</UL>
+</BODY></HTML>
diff --git a/doc/runsvdir.8.html b/doc/runsvdir.8.html
@@ -0,0 +1,55 @@
+
+
+
+<HTML>
+<HEAD>
+<TITLE>runsvdir(8) manual page</TITLE>
+</HEAD>
+<BODY bgcolor=white>
+<a href="http://smarden.org/pape/">G. Pape</a><br><A HREF="index.html">runit</A><hr><P>
+
+<H2><A NAME="sect0">Name</A></H2>
+runsvdir - starts and monitors a collection of <I>runsv(8)</I> processes
+<H2><A NAME="sect1">Synopsis</A></H2>
+<B>runsvdir</B>
+<I>dir</I> [ <I>log</I> ]
+<H2><A NAME="sect2">Description</A></H2>
+<I>dir</I> must be a directory. <I>log</I> is a space holder for
+a readproctitle log and must be at least seven characters long. <P>
+<B>runsvdir</B>
+starts a <B><I>runsv</B>(8)</I> process for each subdirectory in <I>dir</I>, up to a limit of
+1000 subdirectories. <B>runsvdir</B> skips subdirectory names starting with dots.
+<B><I>runsv</B>(8)</I> must be in <B>runsvdir</B>'s PATH. <P>
+At least every five seconds, <B>runsvdir</B>
+checks if <I>dir</I> has changed. If it sees a new subdirectory in <I>dir</I>, it starts
+a new <B><I>runsv</B>(8)</I> process. If it sees an old sudirectory where a <B><I>runsv</B>(8)</I> process
+has exited, it restarts the <B><I>runsv</B>(8)</I> process. If <B>runsvdir</B> sees a subdirectory
+being removed that was previously there, it sends the corresponding <B><I>runsv</B>(8)</I>
+process a TERM signal, stops monitoring this process, and so does not restart
+the <B><I>runsv</B>(8)</I> process if it exits. <P>
+If the <I>log</I> argument is given to <B>runsvdir</B>,
+all output to standard error is redirected to this <I>log</I>, which is similar
+to the <B><I>readproctitle</B>(8)</I> log. To see the most recent error messages, use
+a process-listing tool such as <B><I>ps</B>(1)</I>. <B>runsvdir</B> writes a dot to the readproctitle
+log every 15 minutes so that old error messages expire. <P>
+Normally <B>runsvdir</B>
+is started by <B><I>runit</B>(8)</I> in stage 2.
+<H2><A NAME="sect3">See Also</A></H2>
+<I>runit(8)</I>, <I>runit-init(8)</I>, <I>runsv(8)</I>,
+<I>readproctitle(8)</I>, <I>svscan(8)</I> <P>
+ <I>http://smarden.org/runit/</I><BR>
+ <I>http://cr.yp.to/daemontools.html</I><BR>
+
+<H2><A NAME="sect4">Author</A></H2>
+Gerrit Pape <pape@smarden.org> <P>
+
+<HR><P>
+<A NAME="toc"><B>Table of Contents</B></A><P>
+<UL>
+<LI><A NAME="toc0" HREF="#sect0">Name</A></LI>
+<LI><A NAME="toc1" HREF="#sect1">Synopsis</A></LI>
+<LI><A NAME="toc2" HREF="#sect2">Description</A></LI>
+<LI><A NAME="toc3" HREF="#sect3">See Also</A></LI>
+<LI><A NAME="toc4" HREF="#sect4">Author</A></LI>
+</UL>
+</BODY></HTML>
diff --git a/man/runsv.8 b/man/runsv.8
@@ -0,0 +1,149 @@
+.TH runsv 8
+.SH NAME
+runsv \- starts and monitors a service and optionally an appendant log
+service
+.SH SYNOPSIS
+.B runsv
+.I service
+.SH DESCRIPTION
+.I service
+must be a directory.
+.P
+.B runsv
+switches to the directory
+.I service
+and starts ./run. if ./run exits and ./finish exists,
+.B runsv
+starts ./finish. If ./finish doesn't exist or ./finish exits,
+.B runsv
+restarts ./run.
+.P
+If ./run or ./finish exit immediatly,
+.B runsv
+waits a second before starting ./finish or restarting ./run.
+.P
+If the file
+.IR service /down
+exists,
+.B runsv
+does not start ./run immediately. The control interface (see below) can be
+used to start the service and to give other commands to
+.BR runsv .
+.P
+If the directory
+.IR service /log
+exists,
+.B runsv
+creates a pipe, redirects
+.IR service /run's
+and
+.IR service /finish's
+standard output to the pipe, switches to the directory
+.IR service /log
+and starts ./run (and ./finish) exactly as described above for the
+.I service
+directory. The standard input of the log service a redirected to read from
+the pipe.
+.P
+.B runsv
+maintains status information in a binary format compatible to
+.BR supervise (8)
+in
+.IR service /supervise/status
+( and
+.IR service /log/supervise/status),
+and in a human readable format in
+.IR service /supervise/stat
+( and
+.IR service /log/supervise/stat).
+.SH CONTROL
+The named pipe
+.IR service /supervise/control
+(and
+.IR service /log/supervise/control)
+is provided to give commands to
+.BR runsv .
+You can use
+.BR svc (8)
+to control the service or just write one of the following characters to
+the named pipe:
+.TP
+.B u
+Up. If the service is not running, start it. If the service stops, restart
+it.
+.TP
+.B d
+Down. If the service is running, send it a TERM signal. If ./run exits,
+start ./finish if it exists. After it stops, do not restart service.
+.TP
+.B o
+Once. If the service is not running, start it. Do not restart it if it
+stops.
+.TP
+.B p
+Pause. If the service is running, send it a STOP signal.
+.TP
+.B c
+Continue. If the service is running, send it a CONT signal.
+.TP
+.B h
+Hangup. If the service is running, send it a HUP signal.
+.TP
+.B a
+Alarm. If the service is running, send it a ALRM signal.
+.TP
+.B i
+Interrupt. If the service is running, send it a INT signal.
+.TP
+.B 1
+User-defined 1. If the service is running, send it a USR1 signal.
+.TP
+.B 2
+User-defined 2. If the service is running, send it a USR2 signal.
+.TP
+.B t
+Terminate. If the service is running, send it a TERM signal.
+.TP
+.B k
+Kill. If the service is running, send it a KILL signal.
+.TP
+.B x \fRor \fBe
+Exit.
+If the service is running, send it a TERM signal. Do not restart the
+service. If the service is down, and no log service exists,
+.B runsv
+exits. If the service is down and a log service exists, send a TERM signal
+to the log service. If the log service is down,
+.B runsv
+exits. This command is ignored if it is given to
+.IR service /log/supervise/control.
+.P
+For example, to send a TERM signal to /service/socklog-unix, either do
+ # svc -t /service/socklog-unix
+ or
+ # echo -n t >/service/socklog-unix/supervise/control
+.SH SIGNALS
+If
+.B runsv
+receives a TERM signal, it acts as if the character x was written to the
+control pipe.
+.SH EXIT CODES
+.B runsv
+exits 111 on an error on startup or if another
+.B runsv
+is running in
+.IR service .
+.P
+.B runsv
+exits 0 if it was told to exit.
+.SH SEE ALSO
+runit(8),
+runit-init(8),
+runsvdir(8),
+svc(8),
+supervise(8)
+.P
+ http://smarden.org/runit/
+ http://cr.yp.to/daemontools.html
+.SH AUTHOR
+Gerrit Pape <pape@smarden.org>
diff --git a/man/runsvdir.8 b/man/runsvdir.8
@@ -0,0 +1,83 @@
+.TH runsvdir 8
+.SH NAME
+runsvdir \- starts and monitors a collection of runsv(8) processes
+.SH SYNOPSIS
+.B runsvdir
+.I dir
+[
+.I log
+]
+.SH DESCRIPTION
+.I dir
+must be a directory.
+.I log
+is a space holder for a readproctitle log and must be at least seven
+characters long.
+.P
+.B runsvdir
+starts a
+.BR runsv (8)
+process for each subdirectory in
+.IR dir ,
+up to a limit of 1000 subdirectories.
+.B runsvdir
+skips subdirectory names starting with dots.
+.BR runsv (8)
+must be in
+.BR runsvdir 's
+PATH.
+.P
+At least every five seconds,
+.B runsvdir
+checks if
+.I dir
+has changed. If it sees a new subdirectory in
+.IR dir ,
+it starts a new
+.BR runsv (8)
+process. If it sees an old sudirectory where a
+.BR runsv (8)
+process has exited, it restarts the
+.BR runsv (8)
+process.
+If
+.B runsvdir
+sees a subdirectory being removed that was previously there, it sends
+the corresponding
+.BR runsv (8)
+process a TERM signal, stops monitoring this process, and so does not
+restart the
+.BR runsv (8)
+process if it exits.
+.P
+If the
+.I log
+argument is given to
+.BR runsvdir ,
+all output to standard error is redirected to this
+.IR log ,
+which is similar to the
+.BR readproctitle (8)
+log. To see the most recent error messages, use a process-listing tool
+such as
+.BR ps (1).
+.B runsvdir
+writes a dot to the readproctitle log every 15 minutes so that old
+error messages expire.
+.P
+Normally
+.B runsvdir
+is started by
+.BR runit (8)
+in stage 2.
+.SH SEE ALSO
+runit(8),
+runit-init(8),
+runsv(8),
+readproctitle(8),
+svscan(8)
+.P
+ http://smarden.org/runit/
+ http://cr.yp.to/daemontools.html
+.SH AUTHOR
+Gerrit Pape <pape@smarden.org>