summaryrefslogtreecommitdiff
path: root/doc/s6-svscanctl.html
blob: 6340c14683b56d8fc6cd80c19ff2c811cd06c19c (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
83
84
<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: the s6-svscanctl program</title>
    <meta name="Description" content="s6: the s6-svscanctl program" />
    <meta name="Keywords" content="s6 command s6-svscanctl svscan command service" />
    <!-- <link rel="stylesheet" type="text/css" href="//skarnet.org/default.css" /> -->
  </head>
<body>

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

<h1> The s6-svscanctl program </h1>

<p>
s6-svscanctl sends commands to a running <a href="s6-svscan.html">s6-svscan</a>
process.
</p>

<h2> Interface </h2>

<pre>
     s6-svscanctl [ -zabhitqnN ] <em>scandir</em>
</pre>

<p>
s6-svscanctl sends the given series of commands to the
<a href="s6-svscan.html">s6-svscan</a> process monitoring the
<em>scandir</em> directory, then exits 0. It exits 111 if it cannot send
a command, or 100 if no s6-svscan process is running on <em>scandir</em>.
</p>

<h2> Options </h2>

<ul>
 <li> <tt>-z</tt>&nbsp;: destroy zombies. Immediately triggers s6-svscan's
reaper mechanism. </li>
 <li> <tt>-a</tt>&nbsp;: Alarm. s6-svscan will immediately perform a scan
of <em>scandir</em> to check for services. </li>
 <li> <tt>-b</tt>&nbsp;: abort. s6-svscan will exec into its finishing
procedure. It will not kill any of the maintained s6-supervise processes. </li>
 <li> <tt>-h</tt>&nbsp;: Reload configuration. s6-svscan will perform a scan,
and destroy inactive services. Equivalent to <tt>-an</tt>. </li>
 <li> <tt>-i</tt>&nbsp;: equivalent to <tt>-t</tt> below. </li>
 <li> <tt>-t</tt>&nbsp;: Terminate. s6-svscan will send a
SIGTERM to all the s6-supervise processes supervising a service and a
SIGHUP to all the s6-supervise processes supervising a logger, then exec into
its finish procedure. This means that services will be brought down but
loggers will exit naturally on EOF, and s6-svscan will wait for them to exit
before exec'ing into <tt>.s6-svscan/finish</tt> or exiting itself: it's a
clean shutdown with no loss of logs. </li>
 <li> <tt>-q</tt>&nbsp;: Quit. s6-svscan will send all its s6-supervise processes
a SIGTERM, then exec into its finish procedure. This is different from <tt>-t</tt>
in that services <em>and</em> loggers will be forcibly killed, so the quit
procedure may be faster but in-flight logs may be lost. </li>
 <li> <tt>-n</tt>&nbsp;: nuke. s6-svscan will kill all the
s6-supervise processes it has launched but that did not match a service
directory last time <em>scandir</em> was scanned, i.e. it prunes the
supervision tree so that it matches exactly what was in <em>scandir</em>
at the time of the last scan. A SIGTERM is sent to the s6-supervise processes
supervising services and a SIGHUP is sent to the s6-supervise processes
supervising loggers. </li>
 <li> <tt>-N</tt>&nbsp;: Really nuke. Does the same thing as <tt>-n</tt>,
except that SIGTERM is sent to all the relevant s6-supervise processes, even
if they are supervising loggers. This is not recommended in a situation where
you do not need to tear down the supervision tree. </li>
</ul>

<h2> Internals </h2>

<p>
s6-svscanctl writes control commands into the <tt><em>scandir</em>/.s6-svscan/control</tt>
FIFO. An s6-svscan process running on <em>scandir</em> will be listening to this FIFO,
and will read and interpret those commands.
</p>

</body>
</html>