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
|
<HTML>
<HEAD>
<TITLE>runit(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>
runit - a UNIX process no 1
<H2><A NAME="sect1">Synopsis</A></H2>
<B>runit</B>
<H2><A NAME="sect2">Description</A></H2>
<B>runit</B> must be run
as Unix process no 1. It performs the system's booting, running, and shutdown
in three Stages:
<H2><A NAME="sect3">Stage 1</A></H2>
<B>runit</B> runs <I>/etc/runit/1</I> and waits for it to terminate.
The system's one time tasks are done here. <I>/etc/runit/1</I> has full control
of <I>/dev/console</I> to be able to start an emergency shell if the one time
initialization tasks fail. If <I>/etc/runit/1</I> itself crashes, <B>runit</B> will skip
stage 2 and enter stage 3.
<H2><A NAME="sect4">Stage 2</A></H2>
<B>runit</B> runs <I>/etc/runit/2</I>, which should
not return until system shutdown; if it crashes, it will be restarted. Normally
<I>/etc/runit/2</I> starts <B><I>runsvdir</B>(8)</I>. <B>runit</B> is able to handle the ctrl-alt-del
keyboard request in Stage 2, see below.
<H2><A NAME="sect5">Stage 3</A></H2>
If <B>runit</B> is told to shutdown
the system, or the Stage 2 returns without errors, it terminates Stage
2 if it is running, and runs <I>/etc/runit/3</I>. The systems tasks to shutdown
and halt or reboot are done here. If Stage 3 returns, <B>runit</B> checks if the
file <I>/etc/runit/reboot</I> exists and has the execute by owner permission set.
If so, the system is rebooted, it's halted otherwise.
<H2><A NAME="sect6">Ctrl-alt-del</A></H2>
If <B>runit</B>
receives the ctrl-alt-del keyboard request and the file <I>/etc/runit/ctrlaltdel</I>
exists and has the execute by owner permission set, <B>runit</B> runs <I>/etc/runit/ctrlaltdel</I>,
waits for it to terminate, and then sends itself a CONT signal.
<H2><A NAME="sect7">Signals</A></H2>
<B>runit</B>
only accepts signals in Stage 2. <P>
If <B>runit</B> receives a CONT signal and the
file <I>/etc/runit/stopit</I> exists and has the execute by owner permission set,
<B>runit</B> is told to shutdown the system. <P>
if <B>runit</B> receives an INT signal, a
ctrl-alt-del keyboard request is triggered.
<H2><A NAME="sect8">See Also</A></H2>
<I>runit-init(8)</I>, <I>runsvdir(8)</I>,
<I>runsv(8)</I>, <I>svwaitdown(8)</I>, <I>svwaitup(8)</I>, <I>utmpset(8)</I> <P>
<I>http://smarden.org/runit/</I>
<H2><A NAME="sect9">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">Stage 1</A></LI>
<LI><A NAME="toc4" HREF="#sect4">Stage 2</A></LI>
<LI><A NAME="toc5" HREF="#sect5">Stage 3</A></LI>
<LI><A NAME="toc6" HREF="#sect6">Ctrl-alt-del</A></LI>
<LI><A NAME="toc7" HREF="#sect7">Signals</A></LI>
<LI><A NAME="toc8" HREF="#sect8">See Also</A></LI>
<LI><A NAME="toc9" HREF="#sect9">Author</A></LI>
</UL>
</BODY></HTML>
|