summaryrefslogtreecommitdiff
path: root/doc/s6-linux-init-shutdownd.html
blob: b6ea412fe34f7efda4696d76f0ffd86785914117 (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
<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 internal program</title>
    <meta name="Description" content="s6-linux-init: the s6-linux-init-shutdownd internal 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> internal program </h1>

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

<h2> Interface </h2>

<pre>
     s6-linux-init-shutdownd [ -b <em>bindir</em> ] [ -c <em>basedir</em> ] [ -g <em>gracetime</em> ] <em>fifo</em>
</pre>

<ul>
 <li> <tt>s6-linux-init-shutdownd</tt> opens the <em>fifo</em> named pipe
and listens to it. This is 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>stage3</em> script defined by the last
<a href="s6-linux-init-maker.html">s6-linux-init-maker</a> invocation. </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 the automatically-generated <em>stage 4</em> script,
which unmounts the file systems and halts, powers off or reboots the
machine. </li>
</ul>

<h2> Exit codes </h2>

<ul>
 <li> 100: wrong usage, or user does not have root privileges. </li>
 <li> 111: system call failed. </li>
</ul>

<h2> Options </h2>

<ul>
 <li> <tt>-b&nbsp;<em>bindir</em></tt>&nbsp;: look for the
<a href="//skarnet.org/software/execline/execlineb.html">execlineb</a>
script interpreter in the <em>bindir</em> directory. Default is <tt>/bin</tt>. </li>
 <li> <tt>-c&nbsp;<em>basedir</em></tt>&nbsp;: look for the
<em>stage3</em> and <em>stage4</em> scripts in the <em>basedir</em>
directory. Default is <tt>/etc/s6-linux-init</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>
</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>