diff options
author | Gerrit Pape <pape@smarden.org> | 2002-10-04 09:05:26 +0000 |
---|---|---|
committer | Gerrit Pape <pape@smarden.org> | 2002-10-04 09:05:26 +0000 |
commit | 989c0c438e25f285982b59db50c05de9ac212264 (patch) | |
tree | 4b2e42084b20ef82b9dfa63aa6c8b8621a6634c3 /doc/runlevels.html | |
parent | 592b229608248b1f73e057edc0ddb9b7a75c57ae (diff) | |
download | runit-989c0c438e25f285982b59db50c05de9ac212264.tar.gz runit-989c0c438e25f285982b59db50c05de9ac212264.tar.xz runit-989c0c438e25f285982b59db50c05de9ac212264.zip |
* runsv.c: sleep 1 second before exiting on fatal error.
* runsvdir.c: check service directory's inode and device in addition to mtime; sleep 1 second if stat(service directory) fails. * runsvstat.c: new option -l: only show log service if -l is set. * runsvchdir: new; change service directory runsvdir is running in. 0.6.3.
Diffstat (limited to 'doc/runlevels.html')
-rw-r--r-- | doc/runlevels.html | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/doc/runlevels.html b/doc/runlevels.html new file mode 100644 index 0000000..85272dd --- /dev/null +++ b/doc/runlevels.html @@ -0,0 +1,81 @@ +<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> +<html> +<head> +<title>runit - runlevels</title> +</head> +<body> +<a href="http://smarden.org/pape/">G. Pape</a><br> +<a href="index.html">runit</a><br> +<hr> +<h1>runit - runlevels</h1> +<hr> +<a href="#prepare">Prepare runit for using runlevels</a><br> +<a href="#switch">Switching runlevels</a><br> +<a href="#create">Creating runlevels</a> +<hr> +<a name="prepare"><h3>Prepare runit</h3></a> +If not yet done, configure your system to use <a href="runit.8.html">runit</a> +as process no 1 by following the <a href="replaceinit.html">instructions</a>. +<p> +Create the following direcotories and symlinks: +<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 default /etc/runit/runsvdir/current +</pre> +Copy the content of <tt>/service/</tt> to <tt>/etc/runit/runsvdir/current</tt> +and replace <tt>/service</tt> with a symlink: +<pre> + # cp -pr /service/* /etc/runit/runsvdir/current/ + # mv -f /service /service.old && ln -s /etc/runit/runsvdir/current /service +</pre> +You have now created two runlevels: <tt>default</tt> and <tt>single</tt>. +The <tt>current</tt> runlevel is <tt>default</tt>. It is save to remove +<tt>/service.old</tt> if you don't need it anymore. +<hr> +<a name="switch"><h3>Switching runlevels</h3></a> +Switching runlevels with <i>runit</i> is done by +switching the directory the <a href="runsvdir.8.html">runsvdir</a> program +is running in. This is done by the <a href="runsvchdir.8.html">runsvchdir</a> +program, e.g. to switch to the <tt>single</tt> user runlevel, do: +<pre> + # runsvchdir single +</pre> +To switch back to the <tt>default</tt> runlevel, do: +<pre> + # runsvchdir default +</pre> +See <a href="runsvdir.8.html">the runsvdir program</a> for a description of +what happens when <i>runsvdir</i> sees the directory changed. Note that +there is no guarantee that all services from the <tt>previous</tt> runlevel +will stop, the <a href="runsv.8.html">runsv</a> processes have sent the +services a SIGTERM and wait for them to terminate. You can check the status +of the <tt>previous</tt> runlevel in <tt>/etc/runit/runsvdir/previous/</tt>. +<hr> +<a name="create"><h3>Creating new runlevels</h3></a> +To create a new runlevel, simply create a new service directory in +<tt>/etc/runit/runsvdir</tt>. The name of the runlevel must not start with +a dot and must not be <tt>current</tt>, <tt>current.new</tt> or +<tt>previous</tt>. E.g.: +<pre> + # mkdir /etc/runit/runsvdir/maintenance +</pre> +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/ +</pre> +If you want to switch to the runlevel <tt>mainenance</tt>, do: +<pre> + # runsvchdir maintenance +</pre> +<hr> +<address><a href="mailto:pape@smarden.org"> +Gerrit Pape <pape@smarden.org> +</a></address> +<small>$Id$</small> +</body> +</html> |