66-svctl [ -h ] [ -v <em>verbosity</em> ] [ -l <em>live</em> ] [ -t <em>tree</em> ] [ -T <em>timeout</em> ] [ -n <em>death</em> ] [ -u| U | d | D | r | R | K | X ] <em>service(s)</em>
66-svctl [ -h ] [ -v <em>verbosity</em> ] [ -l <em>live</em> ] [ -t <em>tree</em> ] [ -T <em>timeout</em> ] [ -n <em>death</em> ] [ -u | d | r | K | X ] <em>service(s)</em>
</pre>
<p>
This tool expects to find an already supervised <em>service</em> at <em>live</em> defined in the given <em>tree</em> and an already running <em>scandir</em>.
<br>(!) This tool only deals with <em>'classic'</em> services—see <ahref="66-dbctl.html"><tt>66-dbctl</tt></a> for other types of services.
</p>
<p>Multiple <em>services</em> can be handled by seperating their names with a space. <tt>66-svctl</tt> gathers each of these services in a list called <em>selection</em>.</p>
<p>Multiple <em>services</em> can be handled by seperating their names with a space. <tt>66-svctl</tt> gathers each of these services in a list called <em>selection</em>.
It try to be quicker as possible and send command to the <em>selection</em> asynchronously.</p>
<h2>Exit codes</h2>
<p>
<ul>
<li>0: success, the wanted state has been reached.</li>
<li>110: wrong usage.</li>
<li>111: system call failed.</li>
</ul>
</p>
<h2> Options </h2>
<ul>
...
...
@@ -57,31 +65,24 @@
</li>
<li>
<tt>-T <em>timeout</em> </tt></tt> : specifies a general timeout (in milliseconds)
after which <tt>66-svctl</tt> will exit 111 with an error message if the <em>selection</em> still hasn't reached the desired state for each <em>service</em>;
defaults to 0 (blocks indefinitely).
<tt>-T <em>timeout</em> </tt></tt> : specifies a timeout (in milliseconds)
after which <tt>66-svctl</tt> will stop to try to reach the desired state of the <em>service</em>; defaults to 3000. <em>timeout</em> is apply for each service of the selection. If you want to set <em>timeout</em> for each <em>service</em> separately use the <tt>@timeout-up</tt> or <tt>@timeout-down</tt> key into the <ahref="frontend.html">frontend</a> service file instead. In such case this option has <strong>no effect</strong>.
</li>
<li>
<tt>-n <em>death</em> </tt> : specifies the maximum number of service death events that the supervisor will keep track of.
If the service dies more than this number of times, <tt>66-svctl</tt> will exit 111 with an error message if the <em>services</em> still hasn't reached the desired state.
This option has <strong>no effect</strong> if a <em>maxdeath</em> was defined for the given service at parsing time—see <tt><ahref="66-frontend.html">frontend</a></tt>.
If this option is not specified and no <em>max-death-tally</em> file exists the maximum allowed deaths will default to 3.
If the service dies more than this number of times, <tt>66-svctl</tt> will stop to try to reach the desired state of the <em>services</em>.
This option has <strong>no effect</strong> if a <tt>@maxdeath</tt> was defined for the given service at parsing time—see <tt><ahref="66-frontend.html">frontend</a></tt>.
If this option is not specified and no <em>max-death-tally</em> file exists the maximum allowed deaths will default to 5.
</li>
<li>
<tt>-u|U </tt> : sends an <em>up</em> signal to the <em>service</em>. Uppercase <tt>U</tt> asks for readiness notification and searches for a <em>notification-fd</em>
file—see <tt><ahref="https://skarnet.org/software/s6/notifywhenup.html">service startup notifications</a></tt> and <tt><ahref="66-frontend.html">frontend</a></tt>.
If this file doesn't exist <tt>66-svctl</tt> will automatically change to lowercase <tt>u</tt> and warn the user about the change.
<tt>-u </tt> : sends an <em>up</em> signal to the <em>service</em>. It searches for a <em>notification-fd</em> file—see <tt><ahref="https://skarnet.org/software/s6/notifywhenup.html">service startup notifications</a></tt> and <tt><ahref="66-frontend.html">frontend</a></tt>. If this file exist <tt>66-svctl</tt> will automatically change to uppercase <tt>U</tt>.
</li>
<li>
<tt>-d|D </tt> : sends a <em>down</em> signal to the <em>service</em>. Uppercase <tt>D</tt> asks for readiness notification and searches for a <em>notification-fd</em>
file—see <tt><ahref="https://skarnet.org/software/s6/notifywhenup.html">service startup notifications</a></tt> and <tt><ahref="66-frontend.html">frontend</a></tt>.
If this file doesn't exist <tt>66-svctl</tt> will automatically change to lowercase <tt>d</tt> and warn the user about the change.
<tt>-d </tt> : sends a <em>down</em> signal to the <em>service</em>. It searches for a <em>notification-fd</em> file—see <tt><ahref="https://skarnet.org/software/s6/notifywhenup.html">service startup notifications</a></tt> and <tt><ahref="66-frontend.html">frontend</a></tt>. If this file exist <tt>66-svctl</tt> will automatically change to uppercase <tt>D</tt>.
</li>
<li>
<tt>-r|R </tt> : sends a <em>reload</em> signal to the <em>service</em>. By default, the signal is a SIGTERM; this can be configured via the <tt>@down-signal</tt> field in the <tt><ahref="66-frontend.html">frontend</a></tt> service file. Uppercase <tt>R</tt> asks for readiness notification and searches for a <em>notification-fd</em>
file—see <tt><ahref="https://skarnet.org/software/s6/notifywhenup.html">service startup notifications</a></tt> and <tt><ahref="66-frontend.html">frontend</a></tt>.
If this file doesn't exist <tt>66-svctl</tt> will automatically change to lowercase <tt>r</tt> and warn the user about the change.
<tt>-r </tt> : sends a <em>reload</em> signal to the <em>service</em>. By default, the signal is a SIGTERM; this can be configured via the <tt>@down-signal</tt> field in the <tt><ahref="66-frontend.html">frontend</a></tt> service file. It searches for a <em>notification-fd</em> file—see <tt><ahref="https://skarnet.org/software/s6/notifywhenup.html">service startup notifications</a></tt> and <tt><ahref="66-frontend.html">frontend</a></tt>. If this file exist <tt>66-svctl</tt> will automatically change to uppercase <tt>R</tt>.
</li>
<li>
<tt>-X </tt> : exit. The supervisor of the service will exit too. This command should normally never be used on a working system.
...
...
@@ -90,10 +91,24 @@
<tt>-K </tt> : sends a SIGKILL to the <em>service</em> and keep it down.
<p>You can also send a signal in a similar fashion to a <em>'classic'</em> service with the <tt><ahref="https://skarnet.org/software/s6/s6-svc.html">s6-svc</a></tt> tool which has the philosophy <em>"launch and forget"</em>.
In contrast to <tt>s6-svctl</tt> this does not care for the exit status of the service when a signal is sent.</p>
<p>As an extra convenience the <tt>-n</tt> options allow you to deal directly on the command line with
<em>max-death-tally</em> even if these were not specified explicitely in the services frontend file and no corresponding files exist.</p>