summary refs log tree commit diff
path: root/doc/index.html
blob: 4977c4f556a587dc1ef93b2d4c91dea02fd59dff (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<title>runit - minimal replacement for sysvinit</title>
</head>
<body>
<a href="http://smarden.org/pape/">G. Pape</a>
<hr>
<h1>runit - minimal replacement for <i>sysvinit</i></h1>
<hr>
<a href="install.html">How to install runit</a><br>
<a href="replaceinit.html">How to replace init</a><br>
<a href="usedietlibc.html">How to use dietlibc</a>
<p>
<a href="runscripts.html">A collection of run scripts</a>
<p>
<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>
<a href="svwaitdown.8.html">The <tt>svwaitdown</tt> program</a><br>
<a href="svwaitup.8.html">The <tt>svwaitup</tt> program</a>
<hr>
<i>runit</i> cooperates with djb's
<a href="http://cr.yp.to/daemontools.html">daemontools</a> package to create
a replacement for
<a href="ftp://ftp.cistron.nl/pub/people/miquels/sysvinit/">sysvinit</a>.
<i>runit</i> currently runs on
<a href="http://www.debian.org">Debian GNU/Linux</a> but may be easily
adapted to other unix operating systems using glibc. If <i>runit</i> runs for
you on any other operating system or linux distribution, please let me know.
<p>
<b>Warning:</b> Replacing <i>sysvinit</i> can cause the system's boot to fail.
Make sure you are able to recover and repair your system, for example if you
run a boot loader, it should be able to pass <tt>init=/bin/sh</tt> to the
kernel.
<hr>
The command <a href="runit.8.html">runit</a> is intended to run as Unix
process no 1, it is automatically started by the
<a href="runit-init.8.html">runit-init</a> <tt>/sbin/init</tt>-replacement
if this is started by the kernel.
<p>
<a href="runit.8.html">runit</a> performs the system's <i>booting</i>,
<i>running</i> and <i>shutting down</i> in <b>three stages</b>:
<ul>
  <li><b>Stage 1:</b><br>
  <i>runit</i> starts <tt>/etc/runit/1</tt> and waits for it to
  terminate. The system's one time initialization tasks are done here.
  <li><b>Stage 2:</b><br>
  <i>runit</i> starts <tt>/etc/runit/2</tt> which should not return
  until the system is going to halt or reboot, if it crashes, it will be
  restarted. Normally, <tt>/etc/runit/2</tt> runs
  <a href="http://cr.yp.to/daemontools/svscanboot.html">svscanboot</a>.
  In Stage 2, <i>runit</i> is able to handle the ctrl-alt-del keyboard
  request.
  <li><b>Stage 3:</b><br>
  If <i>runit</i> is told to halt or reboot the system, or the Stage 2
  returns without errors, it terminates Stage 2 if it is running and runs
  <tt>/etc/runit/3</tt>. The systems tasks to shutdown and halt or
  reboot are done here.
</ul>
These are working examples for debian woody:
<a href="debian/1">/etc/runit/1</a>,
<a href="debian/2">/etc/runit/2</a>,
<a href="debian/3">/etc/runit/3</a>.
<p>
The command <a href="runit-init.8.html">runit-init</a> is intended to replace
<tt>/sbin/init</tt>. sysvinit's command <tt>shutdown</tt> will keep working.
Runlevels are not implemented in this Unix process no 1, such can easily be
done in other programs, see
<a href="http://smarden.org/pape/djb/daemontools/noinit.html">
Dependencies and runlevels</a>
for an example, the amount of code in process no 1 should be minimal.
<hr>
See <a href="install.html">How to install runit</a> for installing
<i>runit</i> and <a href="replaceinit.html">How to replace init</a> for
smoothly escaping from <i>sysvinit</i>.
<hr>
If <i>runit</i> is compiled and linked with
<a href="http://www.fefe.de/dietlibc/">dietlibc</a> it yields in a statically
linked <tt>runit</tt> binary of 14k size and this <tt>ps axuw</tt> output
on my system:
<pre>
  USER       PID %CPU %MEM   VSZ  RSS TTY      STAT START   TIME COMMAND
  root         1  0.0  0.0    24   20 ?        S    Nov22   0:01 runit
</pre>
I recommend doing this; for instructions, see
<a href="usedietlibc.html">How to use dietlibc</a>.
<hr>
See <a href="http://smarden.org/runit/">http://smarden.org/runit/</a>
for recent informations.
<hr>
<address><a href="mailto:pape@smarden.org">
Gerrit Pape &lt;pape@smarden.org&gt;
</a></address>
<small>$Id$</small>
</body>
</html>