summaryrefslogtreecommitdiff
path: root/doc/s6-linux-init-shutdownd.html
blob: b0d42f4e472700d4f77c96f703ad50793a8043db (plain)
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
<html>
  <head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta http-equiv="Content-Language" content="en" />
    <title>s6-linux-init: the s6-linux-init-shutdownd program</title>
    <meta name="Description" content="s6-linux-init: the s6-linux-init-shutdownd program" />
    <meta name="Keywords" content="s6 linux init administration root utilities shutdown halt poweroff reboot daemon shutdownd" />
    <!-- <link rel="stylesheet" type="text/css" href="//skarnet.org/default.css" /> -->
  </head>
<body>

<p>
<a href="index.html">s6-linux-init</a><br />
<a href="//skarnet.org/software/">Software</a><br />
<a href="//skarnet.org/">skarnet.org</a>
</p>

<h1> The <tt>s6-linux-init-shutdownd</tt> program </h1>

<p>
<tt>s6-linux-init-shutdownd</tt> is the daemon that manages the shutdown
procedure for an s6-linux-init installation. It is not meant to be called
directly by the user.
</p>

<h2> Interface </h2>

<pre>
     s6-linux-init-shutdownd [ -c <em>basedir</em> ] [ -g <em>gracetime</em> ] [ -C ] [ -B ]
</pre>

<ul>
 <li> <tt>s6-linux-init-shutdownd</tt> opens a named pipe in its current
directory and listens to it. This fifo has a fixed, internal, name: this is
a rendezvous point where programs such as
<a href="s6-linux-init-shutdown.html">s6-linux-init-shutdown</a> send their
commands when they are told to trigger the shutdown procedure. </li>
 <li> When it receives a command to shut down, <tt>s6-linux-init-shutdownd</tt>
first spawns the <em>rc.shutdown</em> script defined by the
<a href="s6-linux-init-maker.html">s6-linux-init-maker</a> invocation that
created the shutdownd service. </li>
 <li> When this script exits, <tt>s6-linux-init-shutdownd</tt> kills all
processes, first with a SIGTERM, then (after the grace time specified by
the shutdown command) with a SIGKILL. </li>
 <li> It then runs an automatically-generated script (called <em>stage 4</em>),
which unmounts the file systems and halts, powers off or reboots the
machine. </li>
</ul>

<h2> Options </h2>

<ul>
 <li> <tt>-c&nbsp;<em>basedir</em></tt>&nbsp;: look for the
<em>rc.shutdown</em> script in the <em>basedir</em><tt>/scripts</tt>
directory. Default is <tt>/etc/s6-linux-init/current</tt>. </li>
 <li> <tt>-g&nbsp;<em>gracetime</em></tt>&nbsp;: if the shutdown command
does not specify a grace time between the SIGTERM and the SIGKILL, use
<em>gracetime</em> milliseconds. Default is 3000. </li>
 <li> <tt>-C</tt>&nbsp;: inform the shutdown daemon that it is running
in a container. This changes the nature of <em>stage 4</em>, since
exiting a container is slightly different from rebooting a real machine
(in particular, pid 1 has to exit, and great care must be given not to
leave any zombie hanging around). </li>
 <li> <tt>-B</tt>&nbsp;: inform the shutdown daemon that no catch-all
logger is running. This also changes the shutdown procedure slightly,
since some operations are specific to the existence of a catch-all
logger. </li>
</ul>

<h2> Notes </h2>

<ul>
 <li> The <a href="s6-linux-init-shutdownd.html">s6-linux-init-shutdownd</a>
binary is not meant to be called directly by administrators. It is run
by a <a href="//skarnet.org/software/s6/">s6</a> service that is automatically
generated by
<a href="s6-linux-init-maker.html">s6-linux-init-maker</a>. </li>
</ul>

</body>
</html>