index.html (11264B)
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> 2 <html> 3 <head> 4 <title>runit - a UNIX init scheme with service supervision</title> 5 </head> 6 <body> 7 <a href="http://smarden.org/pape/">G. Pape</a> 8 <hr> 9 <h1>runit - a UNIX init scheme with service supervision</h1> 10 <hr> 11 <a href="install.html">How to install runit</a><br> 12 <a href="upgrade.html">Upgrading from previous versions of runit</a> 13 <p> 14 <a href="benefits.html">Benefits</a><br> 15 <a href="replaceinit.html">How to replace init</a><br> 16 <a href="useinit.html">How to use runit with current init</a><br> 17 <a href="usedietlibc.html">How to use dietlibc</a><br> 18 <a href="faq.html">Frequently asked questions</a><br> 19 <p> 20 <a href="runlevels.html">Runlevels</a><br> 21 <a href="dependencies.html">Service dependencies</a><br> 22 <a href="runscripts.html">A collection of run scripts</a><br> 23 <p> 24 <a href="runit.8.html">The <tt>runit</tt> program</a><br> 25 <a href="runit-init.8.html">The <tt>runit-init</tt> program</a><br> 26 <br> 27 <a href="sv.8.html">The <tt>sv</tt> program</a><br> 28 <br> 29 <a href="runsvdir.8.html">The <tt>runsvdir</tt> program</a><br> 30 <a href="runsvchdir.8.html">The <tt>runsvchdir</tt> program</a><br> 31 <a href="runsv.8.html">The <tt>runsv</tt> program</a><br> 32 <br> 33 <a href="svlogd.8.html">The <tt>svlogd</tt> program</a><br> 34 <br> 35 <a href="chpst.8.html">The <tt>chpst</tt> program</a><br> 36 <a href="utmpset.8.html">The <tt>utmpset</tt> program</a><br> 37 <hr> 38 <i>runit</i> is a 39 cross-platform Unix init scheme with service supervision, a replacement for 40 <a href="ftp://ftp.cistron.nl/pub/people/miquels/sysvinit/">sysvinit</a>, 41 and other init schemes. 42 It runs on <b>GNU/Linux</b>, <b>*BSD</b>, <b>MacOSX</b>, <b>Solaris</b>, 43 and can easily be adapted to other Unix operating systems. 44 If <i>runit</i> runs for you on any other operating system, please 45 <a href="mailto:supervision@list.skarnet.org">let me know</a>. 46 <hr> 47 <i>runit</i> is discussed on the 48 <a href="http://skarnet.org/lists/#supervision"> 49 <supervision@list.skarnet.org></a> 50 mailing list. 51 Please contact this list and not me privately. 52 <p> 53 To subscribe send an empty email to 54 <a href="mailto:supervision-subscribe@list.skarnet.org"> 55 <supervision-subscribe@list.skarnet.org></a>. 56 <p> 57 Mailing list archives are available at 58 <a href="http://skarnet.org/lists/archive.cgi?2">skarnet.org</a>, and 59 <a href="http://news.gmane.org/gmane.comp.sysutils.supervision.general"> 60 gmane.org</a>. 61 <hr> 62 The program <a href="runit.8.html">runit</a> is intended to run as Unix 63 process no 1, it is automatically started by the 64 <a href="runit-init.8.html">runit-init</a> <tt>/sbin/init</tt>-replacement 65 if this is started by the kernel. 66 <p> 67 <a href="runit.8.html">runit</a> performs the system's <i>booting</i>, 68 <i>running</i> and <i>shutting down</i> in <b>three stages</b>: 69 <ul> 70 <li><b>Stage 1:</b><br> 71 <i>runit</i> starts <tt>/etc/runit/1</tt> and waits for it to 72 terminate. 73 The system's one time initialization tasks are done here. 74 <tt>/etc/runit/1</tt> has full control over <tt>/dev/console</tt> to be 75 able to start an emergency shell in case the one time initialization 76 tasks fail. 77 <li><b>Stage 2:</b><br> 78 <i>runit</i> starts <tt>/etc/runit/2</tt> which should not return 79 until the system is going to halt or reboot; if it crashes, it will be 80 restarted. 81 Normally, <tt>/etc/runit/2</tt> runs 82 <a href="runsvdir.8.html">runsvdir</a>. 83 In Stage 2 <i>runit</i> optionally handles the INT signal (ctrl-alt-del 84 keyboard request on Linux/i386). 85 <li><b>Stage 3:</b><br> 86 If <i>runit</i> is told to halt or reboot the system, or Stage 2 returns 87 without errors, it terminates Stage 2 if it is running, and runs 88 <tt>/etc/runit/3</tt>. 89 The systems tasks to shutdown and halt or reboot are done here. 90 </ul> 91 These are working examples for Debian sarge: 92 <a href="debian/1">/etc/runit/1</a>, 93 <a href="debian/2">/etc/runit/2</a>, 94 <a href="debian/3">/etc/runit/3</a>. 95 <p> 96 The program <a href="runit-init.8.html">runit-init</a> is intended to 97 replace <tt>/sbin/init</tt>. 98 The command <b><tt>init 0</tt></b> tells <i>runit</i> to halt the system, 99 and <b><tt>init 6</tt></b> to reboot. 100 <a href="runlevels.html">Runlevels</a> are handled through the 101 <a href="runsvdir.8.html">runsvdir</a> and 102 <a href="runsvchdir.8.html">runsvchdir</a> programs. 103 Service <a href="dependencies.html">dependencies</a> are resolved 104 automatically. 105 <p> 106 <i>runit</i> is optimized for reliability and small size. 107 The amount of code in process no 1 should be minimal. 108 <hr> 109 See <a href="install.html">How to install runit</a> for installing 110 <i>runit</i>, and <a href="replaceinit.html">How to replace init</a> for 111 configuring <i>runit</i> to run as process no 1. 112 See <a href="useinit.html">How to use with current init</a> if you want to 113 use <i>runit</i> without replacing the current init scheme. 114 Please read the list of 115 <a href="faq.html">Frequently asked questions with answers</a>. 116 <hr> 117 If <i>runit</i> on Linux is compiled and linked with the 118 <a href="http://www.fefe.de/dietlibc/">dietlibc</a>, it yields in a 119 statically linked <tt>runit</tt> binary of 8.5k size and this 120 <tt>ps axuw</tt> output on my system: 121 <pre> 122 USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND 123 root 1 0.0 0.0 20 16 ? S 2002 0:02 runit 124 </pre> 125 I recommend doing this; for instructions, see 126 <a href="usedietlibc.html">How to use dietlibc</a>. 127 <hr> 128 The following distributions are known to include or package <i>runit</i>: 129 <ul> 130 <li><a href="http://packages.qa.debian.org/runit"> 131 Debian GNU/Linux</a> (as alternative init scheme) 132 <li><a href="http://www.freshports.org/sysutils/runit/"> 133 FreeBSD</a> 134 <li><a href="http://www.openbsd.org/cgi-bin/cvsweb/ports/sysutils/runit/"> 135 OpenBSD</a> 136 <li><a href="http://pkgsrc.se/wip/runit/"> 137 NetBSD</a> 138 <li><a href="http://packages.ubuntu.com/runit"> 139 Ubuntu</a> (as alternative init scheme) 140 <li><a href="http://packages.gentoo.org/package/sys-process/runit"> 141 Gentoo</a> 142 <li><a href="https://code.google.com/p/runit-for-lfs/"> 143 Linux from Scratch</a> 144 <li><a href="http://www.finnix.org/"> 145 Finnix</a> 146 <li><a href="http://www.smeserver.org/"> 147 SME server</a> 148 <li><a href="http://linux-vserver.org/Running_runit-supervised_services_inside_a_vserver"> 149 Linux-VServer</a> 150 <li><a href="http://www.t2-project.org/"> 151 T2</a> 152 <li><a href="http://www.gobolinux.org/"> 153 GoboLinux</a> 154 <li><a href="http://www.dragora.org/"> 155 Dragora GNU/Linux</a> (as default init scheme) 156 <li><a href="https://wiki.archlinux.org/index.php/Runit"> 157 ArchLinux</a> 158 <li><a href="http://www.opensde.org/"> 159 OpenSDE</a> 160 <li><a href="http://zinux.cynicbytrade.com/"> 161 Zinux Linux</a> (as default init scheme) 162 <li><a href="http://deepofix.org/"> 163 deepOfix Mail Server</a> (as default init scheme) 164 </ul> 165 If you know of more distributions, please 166 <a href="mailto:supervision@list.skarnet.org">let me know</a>. 167 <hr> 168 <b><i>runit</i> in use</b>: 169 I replaced <i>sysvinit</i> successfully with <i>runit</i> on several server 170 systems and a laptop running Debian/GNU Linux sarge, woody, and potato. 171 Here is an example: 172 <pre> 173 # strings /proc/1/exe |grep Id 174 $Id: runit.c,v 1.7 2002/02/13 09:59:52 pape Exp $ 175 # uptime 176 11:59:13 up 365 days, 23:22, 3 users, load average: 0.01, 0.02, 0.00 177 # ps axuw |head -n20 178 USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND 179 root 1 0.0 0.0 20 16 ? S 2002 0:07 runit 180 root 2 0.0 0.0 0 0 ? SW 2002 0:00 [keventd] 181 root 3 0.0 0.0 0 0 ? SWN 2002 0:51 [ksoftirqd_CPU0] 182 root 4 0.0 0.0 0 0 ? SW 2002 144:38 [kswapd] 183 root 5 0.0 0.0 0 0 ? SW 2002 0:08 [bdflush] 184 root 6 0.0 0.0 0 0 ? SW 2002 7:24 [kupdated] 185 root 168 0.0 0.0 1652 168 ? S 2002 0:27 /usr/sbin/cron 186 root 174 0.0 0.0 36 24 ? S 2002 1:06 runsvdir /var/service log: ............................................................................................... 187 root 176 0.0 0.0 20 20 ? S 2002 0:00 runsv qmail-send 188 root 177 0.0 0.0 20 20 ? S 2002 0:00 runsv getty-5 189 root 178 0.0 0.0 20 20 ? S 2002 0:00 runsv getty-4 190 root 179 0.0 0.0 20 20 ? S 2002 0:00 runsv getty-3 191 root 180 0.0 0.0 20 20 ? S 2002 0:00 runsv getty-2 192 root 182 0.0 0.0 20 20 ? S 2002 0:00 runsv socklog-unix 193 root 183 0.0 0.0 1256 4 tty5 S 2002 0:00 /sbin/getty 38400 tty5 linux 194 root 184 0.0 0.0 1256 4 tty3 S 2002 0:00 getty 38400 tty3 linux 195 root 185 0.0 0.0 20 20 ? S 2002 0:00 runsv socklog-klog 196 root 186 0.0 0.0 20 20 ? S 2002 0:00 runsv ssh 197 root 187 0.0 0.0 1256 4 tty4 S 2002 0:00 getty 38400 tty4 linux 198 # pstree 199 runit-+-bdflush 200 |-cron 201 |-gcache 202 |-keventd 203 |-ksoftirqd_CPU0 204 |-kswapd 205 |-kupdated 206 `-runsvdir-+-runsv-+-multilog 207 | `-qmail-send-+-qmail-clean 208 | |-qmail-lspawn 209 | `-qmail-rspawn---qmail-remote 210 |-4*[runsv---getty] 211 |-2*[runsv-+-multilog] 212 | `-socklog] 213 |-runsv-+-multilog 214 | `-sshd-+-sshd---sshd---bash---bash---pstree 215 | `-sshd---sshd---rsync 216 |-runsv---clockspeed 217 |-runsv-+-dnscache 218 | `-multilog 219 |-runsv---apache-ssl-+-9*[apache-ssl] 220 | |-gcache 221 | `-4*[multilog] 222 |-7*[runsv-+-multilog] 223 | `-tcpserver] 224 |-4*[runsv-+-multilog] 225 | `-tinydns] 226 |-runsv---uncat 227 |-2*[runsv-+-multilog] 228 | `-tcpsvd] 229 |-runsv-+-svlogd 230 | `-tcpsvd-+-smtpfront-qmail 231 | `-smtpfront-qmail---qmail-queue 232 `-runsv-+-svlogd 233 `-tcpsvd---bincimap-up---bincimapd 234 </pre> 235 <hr> 236 See <a href="http://smarden.org/runit/">http://smarden.org/runit/</a> 237 for recent informations. 238 <hr> 239 Related links: 240 <ul> 241 <li><a href="http://www.fefe.de/minit/"> 242 minit</a> - a small yet feature-complete init 243 <li><a href="http://multivac.cwru.edu/svscan-1/"> 244 svscan as process 1</a> - by Paul Jarc 245 <li><a href="ftp://ftp.cistron.nl/pub/people/miquels/sysvinit/"> 246 sysvinit</a> - source code 247 <li><a href="http://www.freebsd.org/cgi/cvsweb.cgi/src/sbin/init/"> 248 FreeBSD's init</a> - CVS repository 249 <li><a href="http://cvsweb.netbsd.org/bsdweb.cgi/src/sbin/init/"> 250 NetBSD's init</a> - CVS repository 251 <li><a href="http://www.openbsd.org/cgi-bin/cvsweb/src/sbin/init/"> 252 OpenBSD's init</a> - CVS repository 253 <li><a href="http://www.atnf.csiro.au/~rgooch/linux/boot-scripts/"> 254 Linux Boot Scripts</a> - by Richard Gooch 255 </ul> 256 <hr> 257 <address><a href="mailto:pape@smarden.org"> 258 Gerrit Pape <pape@smarden.org> 259 </a></address> 260 </body> 261 </html>