commit e3ba2bd75ca68ace757010e74f16615bf1b7abc7
parent e109acf537cd79bfb7dde6868ae3799ed6f92ff5
Author: Gerrit Pape <pape@smarden.org>
Date: Wed, 24 Aug 2005 07:33:20 +0000
html.
Diffstat:
M | doc/chpst.8.html | | | 117 | +++++++++++++++++++++++++++++++++++++++++--------------------------------------- |
M | doc/sv.8.html | | | 88 | +++++++++++++++++++++++++++++++++++++++++++------------------------------------ |
2 files changed, 108 insertions(+), 97 deletions(-)
diff --git a/doc/chpst.8.html b/doc/chpst.8.html
@@ -26,95 +26,98 @@ chpst - runs a program with a changed process state
<dt><b>-u <i>user[:group]</b> </i></dt>
<dd>setuidgid. Set uid and gid to the <i>user</i>’s uid and
gid. If <i>user</i> is followed by a colon and a <i>group</i>, set the gid to <i>group</i>’s gid
-instead of <i>user</i>’s gid. All supplementary groups are removed. </dd>
+instead of <i>user</i>’s gid. If <i>group</i> consists of a colon-separated list of group
+names, <b>chpst</b> sets the group ids of all listed groups. All initial supplementary
+groups are removed. </dd>
-<dt><b>-U <i>user[:group]</b>
-</i></dt>
-<dd>envuidgid. Set the environment variables $UID and $GID to the <i>user</i>’s uid
-and gid. If <i>user</i> is followed by a colon and a <i>group</i>, set $GID to the <i>group</i>’s
-gid instead of <i>user</i>’s gid. </dd>
+<dt><b>-U <i>user[:group]</b> </i></dt>
+<dd>envuidgid. Set the environment variables
+$UID and $GID to the <i>user</i>’s uid and gid. If <i>user</i> is followed by a colon and
+a <i>group</i>, set $GID to the <i>group</i>’s gid instead of <i>user</i>’s gid. If <i>group</i> consists
+of a colon-separated list of group names, <b>chpst</b> sets the group ids of all
+listed groups. All initial supplementary groups are removed. </dd>
<dt><b>-e <i>dir</b> </i></dt>
-<dd>envdir. Set various environment variables
-as specified by files in the directory <i>dir</i>: If <i>dir</i> contains a file named
-<i>k</i> whose first line is <i>v</i>, <b>chpst</b> removes the environment variable <i>k</i> if it
-exists, and then adds the environment variable <i>k</i> with the value <i>v</i>. The name
-<i>k</i> must not contain =. Spaces and tabs at the end of <i>v</i> are removed, and nulls
-in <i>v</i> are changed to newlines. If the file <i>k</i> is empty (0 bytes long), <b>chpst</b>
-removes the environment variable <i>k</i> if it exists, without adding a new variable.
-</dd>
+<dd>envdir.
+Set various environment variables as specified by files in the directory
+<i>dir</i>: If <i>dir</i> contains a file named <i>k</i> whose first line is <i>v</i>, <b>chpst</b> removes
+the environment variable <i>k</i> if it exists, and then adds the environment
+variable <i>k</i> with the value <i>v</i>. The name <i>k</i> must not contain =. Spaces and tabs
+at the end of <i>v</i> are removed, and nulls in <i>v</i> are changed to newlines. If
+the file <i>k</i> is empty (0 bytes long), <b>chpst</b> removes the environment variable
+<i>k</i> if it exists, without adding a new variable. </dd>
<dt><b>-/ <i>root</b> </i></dt>
-<dd>chroot. Change the root directory to <i>root</i> before starting <i>prog</i>. </dd>
+<dd>chroot. Change the
+root directory to <i>root</i> before starting <i>prog</i>. </dd>
-<dt><b>-n
-<i>inc</b> </i></dt>
-<dd>nice. Add <i>inc</i> to the <i><b>nice</b>(2)</i> value before starting <i>prog</i>. <i>inc</i> must be
-an integer, and may start with a minus or plus. </dd>
+<dt><b>-n <i>inc</b> </i></dt>
+<dd>nice. Add <i>inc</i> to the <i><b>nice</b>(2)</i>
+value before starting <i>prog</i>. <i>inc</i> must be an integer, and may start with a
+minus or plus. </dd>
<dt><b>-l <i>lock</b> </i></dt>
-<dd>lock. Open the file
-<i>lock</i> for writing, and obtain an exclusive lock on it. <i>lock</i> will be created
-if it does not exist. If <i>lock</i> is locked by another process, wait until a
-new lock can be obtained. </dd>
+<dd>lock. Open the file <i>lock</i> for writing, and obtain an
+exclusive lock on it. <i>lock</i> will be created if it does not exist. If <i>lock</i>
+is locked by another process, wait until a new lock can be obtained. </dd>
-<dt><b>-L <i>lock</b> </i></dt>
-<dd>The same as -l, but fail immediately if
-<i>lock</i> is locked by another process. </dd>
+<dt><b>-L <i>lock</b>
+</i></dt>
+<dd>The same as -l, but fail immediately if <i>lock</i> is locked by another process.
+</dd>
<dt><b>-m <i>bytes</b> </i></dt>
-<dd>limit memory. Limit the data segment,
-stack segment, locked physical pages, and total of all segment per process
-to <i>bytes</i> bytes each. </dd>
+<dd>limit memory. Limit the data segment, stack segment, locked physical
+pages, and total of all segment per process to <i>bytes</i> bytes each. </dd>
<dt><b>-o <i>n</b> </i></dt>
-<dd>limit open files. Limit the number of open file
-descriptors per process to <i>n</i>. </dd>
+<dd>limit
+open files. Limit the number of open file descriptors per process to <i>n</i>. </dd>
-<dt><b>-p <i>n</b> </i></dt>
-<dd>limit processes. Limit the number of processes
-per uid to <i>n</i>. </dd>
+<dt><b>-p
+<i>n</b> </i></dt>
+<dd>limit processes. Limit the number of processes per uid to <i>n</i>. </dd>
<dt><b>-f <i>bytes</b> </i></dt>
-<dd>limit output size. Limit the output file size to <i>bytes</i>
-bytes. </dd>
+<dd>limit
+output size. Limit the output file size to <i>bytes</i> bytes. </dd>
<dt><b>-c <i>bytes</b> </i></dt>
-<dd>limit core size. Limit the core file size to <i>bytes</i> bytes. </dd>
+<dd>limit core
+size. Limit the core file size to <i>bytes</i> bytes. </dd>
-<dt><b>-v</b>
-</dt>
-<dd>verbose. Print verbose messages to standard error. This includes warnings
-about limits unsupported by the system. </dd>
+<dt><b>-v</b> </dt>
+<dd>verbose. Print verbose messages
+to standard error. This includes warnings about limits unsupported by the
+system. </dd>
<dt><b>-P</b> </dt>
-<dd>pgrphack. Run <i>prog</i> in a new process
-group. </dd>
+<dd>pgrphack. Run <i>prog</i> in a new process group. </dd>
<dt><b>-0</b> </dt>
-<dd>Close standard input before starting <i>prog</i>. </dd>
+<dd>Close standard input
+before starting <i>prog</i>. </dd>
<dt><b>-1</b> </dt>
-<dd>Close standard output
-before starting <i>prog</i>. </dd>
+<dd>Close standard output before starting <i>prog</i>. </dd>
<dt><b>-2</b> </dt>
-<dd>Close standard error before starting <i>prog</i>. </dd>
+<dd>Close
+standard error before starting <i>prog</i>. </dd>
</dl>
<h2><a name='sect4'>Exit Codes</a></h2>
-<b>chpst</b>
-exits 100 when called with wrong options. It prints an error message and
-exits 111 if it has trouble changing the process state. Otherwise its exit
-code is the same as that of <i>prog</i>.
+<b>chpst</b> exits 100 when called
+with wrong options. It prints an error message and exits 111 if it has trouble
+changing the process state. Otherwise its exit code is the same as that
+of <i>prog</i>.
<h2><a name='sect5'>Emulation</a></h2>
-If <b>chpst</b> is called as <i><b>envdir</b>(8)</i>,
-<i><b>envuidgid</b>(8)</i>, <i><b>pgrphack</b>(8)</i>, <i><b>setlock</b>(8)</i>, <i><b>setuidgid</b>(8)</i>, or <i><b>softlimit</b>(8)</i>, it
-emulates the functionality of these programs from the daemontools package
-respectively.
+If <b>chpst</b> is called as <i><b>envdir</b>(8)</i>, <i><b>envuidgid</b>(8)</i>, <i><b>pgrphack</b>(8)</i>,
+<i><b>setlock</b>(8)</i>, <i><b>setuidgid</b>(8)</i>, or <i><b>softlimit</b>(8)</i>, it emulates the functionality
+of these programs from the daemontools package respectively.
<h2><a name='sect6'>See Also</a></h2>
-<i>runsv(8)</i>, <i>runsvctrl(8)</i>, <i>runsvstat(8)</i>, <i>runsvdir(8)</i>,
-<i>setsid(2)</i> <p>
+<i>runsv(8)</i>,
+<i>runsvctrl(8)</i>, <i>runsvstat(8)</i>, <i>runsvdir(8)</i>, <i>setsid(2)</i> <p>
<i>http://smarden.org/runit/</i><br>
<i>http://cr.yp.to/daemontools.html</i><br>
diff --git a/doc/sv.8.html b/doc/sv.8.html
@@ -77,17 +77,22 @@ of these <i>command</i>s.
<dt><b>start</b> </dt>
<dd>Same as <i>up</i>, but wait up to 7 seconds for the command
-to take effect. Then report the status or timeout. </dd>
+to take effect. Then report the status or timeout. If the script <i>./check</i> exists
+in the service directory, <b>sv</b> runs this script to check whether the service
+is up and available; it’s considered to be available if <i>./check</i> exits with
+0. </dd>
<dt><b>stop</b> </dt>
-<dd>Same as <i>down</i>, but
-wait up to 7 seconds for the service to become down. Then report the status
-or timeout. </dd>
+<dd>Same as <i>down</i>, but wait up to 7 seconds for the service to become
+down. Then report the status or timeout. </dd>
<dt><b>restart</b> </dt>
-<dd>Send the commands <i>term</i>, <i>cont</i>, and <i>up</i> to the service,
-and wait up to 7 seconds for the service to restart. Then report the status
-or timeout. </dd>
+<dd>Send the commands <i>term</i>,
+<i>cont</i>, and <i>up</i> to the service, and wait up to 7 seconds for the service to
+restart. Then report the status or timeout. If the script <i>./check</i> exists in
+the service directory, <b>sv</b> runs this script to check whether the service
+is up and available again; it’s considered to be available if <i>./check</i> exits
+with 0. </dd>
<dt><b>shutdown</b> </dt>
<dd>Same as <i>exit</i>, but wait up to 7 seconds for the <i><b>runsv</b>(8)</i>
@@ -107,13 +112,15 @@ service the <i>kill</i> command. </dd>
<dt><b>force-restart</b> </dt>
<dd>Send the service the <i>term</i>, <i>cont</i> and
<i>up</i> commands, and wait up to 7 seconds for the service to restart. Then report
-the status, and on timeout send the service the <i>kill</i> command. </dd>
-
-<dt><b>force-shutdown</b>
-</dt>
-<dd>Same as <i>exit</i>, but wait up to 7 seconds for the <i><b>runsv</b>(8)</i> process to terminate.
-Then report the status, and on timeout send the service the <i>kill</i> command.
-</dd>
+the status, and on timeout send the service the <i>kill</i> command. If the script
+<i>./check</i> exists in the service directory, <b>sv</b> runs this script to check whether
+the service is up and available again; it’s considered to be available if
+<i>./check</i> exits with 0. </dd>
+
+<dt><b>force-shutdown</b> </dt>
+<dd>Same as <i>exit</i>, but wait up to 7 seconds
+for the <i><b>runsv</b>(8)</i> process to terminate. Then report the status, and on timeout
+send the service the <i>kill</i> command. </dd>
</dl>
<h2><a name='sect5'>Options</a></h2>
@@ -121,13 +128,13 @@ Then report the status, and on timeout send the service the <i>kill</i> command.
<dl>
<dt><b>-v</b> </dt>
-<dd>If the <i>command</i> is up, down, term, once, or exit, then wait up
-to 7 seconds for the command to take effect. Then report the status or timeout.
-</dd>
+<dd>If the <i>command</i> is up, down,
+term, once, or exit, then wait up to 7 seconds for the command to take
+effect. Then report the status or timeout. </dd>
<dt><b>-w <i>sec</b> </i></dt>
-<dd>Override the default timeout of 7 seconds with <i>sec</i> seconds. This option
-implies <i>-v</i>. </dd>
+<dd>Override the default timeout
+of 7 seconds with <i>sec</i> seconds. This option implies <i>-v</i>. </dd>
</dl>
<h2><a name='sect6'>Environment</a></h2>
@@ -135,34 +142,35 @@ implies <i>-v</i>. </dd>
<dl>
<dt><b>SVDIR</b> </dt>
-<dd>The environment variable $SVDIR overrides the
-default services directory <i>/var/service/</i>. </dd>
+<dd>The
+environment variable $SVDIR overrides the default services directory <i>/var/service/</i>.
+</dd>
<dt><b>SVWAIT</b> </dt>
-<dd>The environment variable
-$SVWAIT overrides the default 7 seconds to wait for a command to take effect.
-It is overridden by the -w option. </dd>
+<dd>The environment variable $SVWAIT overrides the default 7 seconds
+to wait for a command to take effect. It is overridden by the -w option. </dd>
</dl>
-<h2><a name='sect7'>Exit Codes</a></h2>
-<b>sv</b> exits 0, if the <i>command</i> was
-successfully sent to all <i>services</i>, and, if it was told to wait, the <i>command</i>
-has taken effect to all services. <p>
-For each <i>service</i> that caused an error
-(e.g. the directory is not controlled by a <i><b>runsv</b>(8)</i> process, or <b>sv</b> timed
-out while waiting), <b>sv</b> increases the exit code by one and exits non zero.
-The maximum is 99. <b>sv</b> exits 100 on error. <p>
-If <b>sv</b> is called with a base name
-other than <b>sv</b>, it exits 1 on timeout or trouble sending the command. If
-the <i>command</i> is <b>status</b>, it exits 3 if the service is down, and 4 if the
-status is unknown. It exits 2 on wrong usage, and 151 on error.
-<h2><a name='sect8'>See Also</a></h2>
-<i>runsv(8)</i>,
-<i>runsvdir(8)</i>, <i>runsvchdir(8)</i>, <i>chpst(8)</i>, <i>svlogd(8)</i>, <i>runit(8)</i>, <i>runit-init(8)</i>
+<h2><a name='sect7'>Exit
+Codes</a></h2>
+<b>sv</b> exits 0, if the <i>command</i> was successfully sent to all <i>services</i>,
+and, if it was told to wait, the <i>command</i> has taken effect to all services.
<p>
+For each <i>service</i> that caused an error (e.g. the directory is not controlled
+by a <i><b>runsv</b>(8)</i> process, or <b>sv</b> timed out while waiting), <b>sv</b> increases the
+exit code by one and exits non zero. The maximum is 99. <b>sv</b> exits 100 on error.
+<p>
+If <b>sv</b> is called with a base name other than <b>sv</b>, it exits 1 on timeout or
+trouble sending the command. If the <i>command</i> is <b>status</b>, it exits 3 if the
+service is down, and 4 if the status is unknown. It exits 2 on wrong usage,
+and 151 on error.
+<h2><a name='sect8'>See Also</a></h2>
+<i>runsv(8)</i>, <i>runsvdir(8)</i>, <i>runsvchdir(8)</i>, <i>chpst(8)</i>,
+<i>svlogd(8)</i>, <i>runit(8)</i>, <i>runit-init(8)</i> <p>
<i>http://smarden.org/runit/</i>
<h2><a name='sect9'>Author</a></h2>
-Gerrit Pape <pape@smarden.org> <p>
+Gerrit
+Pape <pape@smarden.org> <p>
<hr><p>
<a name='toc'><b>Table of Contents</b></a><p>