2
2
<a href="systemd.directives.html">Directives </a>·
3
3
<a href="../python-systemd/index.html">Python </a>·
4
4
<a href="../libudev/index.html">libudev </a>·
5
<a href="../libudev/index.html">gudev </a><hr><div class="refentry"><a name="systemctl"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>systemctl — Control the systemd system and service manager</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">systemctl</code> [OPTIONS...] COMMAND [NAME...]</p></div></div><div class="refsect1"><a name="idp3911248"></a><h2>Description</h2><p><span class="command"><strong>systemctl</strong></span> may be used to
5
<a href="../libudev/index.html">gudev </a><span style="float:right">systemd 202</span><hr><div class="refentry"><a name="systemctl"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>systemctl — Control the systemd system and service manager</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">systemctl</code> [OPTIONS...] COMMAND [NAME...]</p></div></div><div class="refsect1"><a name="idp124480"></a><h2>Description</h2><p><span class="command"><strong>systemctl</strong></span> may be used to
6
6
introspect and control the state of the
7
7
<a href="systemd.html"><span class="citerefentry"><span class="refentrytitle">systemd</span>(1)</span></a>
8
system and service manager.</p></div><div class="refsect1"><a name="idp3913840"></a><h2>Options</h2><p>The following options are understood:</p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="option">-h</code>, </span><span class="term"><code class="option">--help</code></span></dt><dd><p>Prints a short help
9
text and exits.</p></dd><dt><span class="term"><code class="option">--version</code></span></dt><dd><p>Prints a short version string and exits.</p></dd><dt><span class="term"><code class="option">-t</code>, </span><span class="term"><code class="option">--type=</code></span></dt><dd><p>The argument should be a unit type name such as
10
<code class="option">service</code> and <code class="option">socket</code>, or a
11
unit load state such as <code class="option">loaded</code> and
12
<code class="option">masked</code>.
13
</p><p>If the argument is a unit type, when listing units,
14
limit display to certain unit types. If not specified units
15
of all types will be shown.</p><p>If the argument is a unit load state, when listing
16
units, limit display to certain unit types. If not specified
17
units of in all load states will be shown.</p><p>As a special case, if the argument is
8
system and service manager.</p></div><div class="refsect1"><a name="idp126992"></a><h2>Options</h2><p>The following options are understood:</p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="option">-h</code>, </span><span class="term"><code class="option">--help</code></span></dt><dd><p>Prints a short help
9
text and exits.</p></dd><dt><span class="term"><code class="option">--version</code></span></dt><dd><p>Prints a short version string and exits.</p></dd><dt><span class="term"><code class="option">-t</code>, </span><span class="term"><code class="option">--type=</code></span></dt><dd><p>The argument should be a comma separated list of unit
10
types such as <code class="option">service</code> and
11
<code class="option">socket</code>, or unit load states such as
12
<code class="option">loaded</code> and <code class="option">masked</code>
13
(types and states can be mixed).</p><p>If one of the arguments is a unit type, when listing
14
units, limit display to certain unit types. Otherwise units
15
of all types will be shown.</p><p>If one of the arguments is a unit load state, when
16
listing units, limit display to certain unit
17
types. Otherwise units of in all load states will be
18
shown.</p><p>As a special case, if one of the arguments is
18
19
<code class="option">help</code>, a list of allowed values will be
19
20
printed and the program will exit.</p></dd><dt><span class="term"><code class="option">-p</code>, </span><span class="term"><code class="option">--property=</code></span></dt><dd><p>When showing unit/job/manager properties with the
20
21
<span class="command"><strong>show</strong></span> command, limit display to certain
22
23
set properties are shown. The argument should be a
23
24
comma-seperated list of property names, such as
24
25
<code class="literal">MainPID</code>. If specified more than once all
25
properties with the specified names are shown.</p></dd><dt><span class="term"><code class="option">-a</code>, </span><span class="term"><code class="option">--all</code></span></dt><dd><p>When listing units, show all units, regardless of
26
their state, including inactive units. When showing
26
properties with the specified names are shown.</p></dd><dt><span class="term"><code class="option">-a</code>, </span><span class="term"><code class="option">--all</code></span></dt><dd><p>When listing units, show all loaded units, regardless
27
of their state, including inactive units. When showing
27
28
unit/job/manager properties, show all properties regardless
28
whether they are set or not.</p></dd><dt><span class="term"><code class="option">--failed</code></span></dt><dd><p>When listing units, show only failed units. Do not
29
whether they are set or not.</p><p>To list all units installed on the system, use the
30
<span class="command"><strong>list-unit-files</strong></span> command instead.</p></dd><dt><span class="term"><code class="option">--failed</code></span></dt><dd><p>When listing units, show only failed units. Do not
29
31
confuse with <code class="option">--fail</code>.</p></dd><dt><span class="term"><code class="option">--full</code></span></dt><dd><p>Do not ellipsize unit names, cgroup members, and
30
32
truncate unit descriptions in the output of
31
33
<span class="command"><strong>list-units</strong></span> and
33
35
unfinished job, fail the command. If this is not specified
34
36
the requested operation will replace the pending job, if
35
37
necessary. Do not confuse with
36
<code class="option">--failed</code>.</p></dd><dt><span class="term"><code class="option">--irreversible</code></span></dt><dd><p>Mark this transaction's jobs as irreversible. This prevents
38
<code class="option">--failed</code>.</p></dd><dt><span class="term"><code class="option">--show-types</code></span></dt><dd><p>When showing sockets, show the type of the socket.</p></dd><dt><span class="term"><code class="option">--irreversible</code></span></dt><dd><p>Mark this transaction's jobs as irreversible. This prevents
37
39
future conflicting transactions from replacing these jobs.
38
40
The jobs can still be cancelled using the <span class="command"><strong>cancel</strong></span>
39
41
command.</p></dd><dt><span class="term"><code class="option">--ignore-dependencies</code></span></dt><dd><p>When enqueuing a new job ignore all its dependencies
130
132
formatting of the journal entries that are shown. For the
131
133
available choices see
132
134
<a href="journalctl.html"><span class="citerefentry"><span class="refentrytitle">journalctl</span>(1)</span></a>.
133
Defaults to <code class="literal">short</code>.</p></dd></dl></div></div><div class="refsect1"><a name="idp5032336"></a><h2>Commands</h2><p>The following commands are understood:</p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><span class="command"><strong>list-units</strong></span></span></dt><dd><p>List known units (subject to limitations specified
134
with <code class="option">-t</code>).</p><p>This is the default command.</p></dd><dt><span class="term"><span class="command"><strong>start <em class="replaceable"><code>NAME</code></em>...</strong></span></span></dt><dd><p>Start (activate) one or more units specified on the
135
Defaults to <code class="literal">short</code>.</p></dd></dl></div></div><div class="refsect1"><a name="idp4746912"></a><h2>Commands</h2><p>The following commands are understood:</p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><span class="command"><strong>list-units</strong></span></span></dt><dd><p>List known units (subject to limitations specified
136
with <code class="option">-t</code>).</p><p>This is the default command.</p></dd><dt><span class="term"><span class="command"><strong>list-sockets</strong></span></span></dt><dd><p>List socket units ordered by the listening address. Produces output
138
</p><pre class="programlisting">
139
LISTEN UNIT ACTIVATES
140
/dev/initctl systemd-initctl.socket systemd-initctl.service
142
[::]:22 sshd.socket sshd.service
143
kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service
147
Note: because the addresses might contains spaces, this output
148
is not suitable for programatic consumption.
149
</p><p>See also the options <code class="option">--show-types</code>,
150
<code class="option">--all</code>, and <code class="option">--failed</code>.</p></dd><dt><span class="term"><span class="command"><strong>start <em class="replaceable"><code>NAME</code></em>...</strong></span></span></dt><dd><p>Start (activate) one or more units specified on the
135
151
command line.</p></dd><dt><span class="term"><span class="command"><strong>stop <em class="replaceable"><code>NAME</code></em>...</strong></span></span></dt><dd><p>Stop (deactivate) one or more units specified on the
136
152
command line.</p></dd><dt><span class="term"><span class="command"><strong>reload <em class="replaceable"><code>NAME</code></em>...</strong></span></span></dt><dd><p>Asks all units listed on the command line to reload
137
153
their configuration. Note that this will reload the
246
262
unit name, plus a control group specification in the syntax
247
263
<em class="replaceable"><code>CONTROLLER</code></em>:<em class="replaceable"><code>PATH</code></em>
248
264
or <em class="replaceable"><code>CONTROLLER</code></em>. In the latter syntax
249
(where the path is ommitted) the default unit control group
265
(where the path is omitted) the default unit control group
250
266
path is implied. Examples: <code class="literal">cpu</code> or
251
267
<code class="literal">cpu:/foo/bar</code>. If a unit is removed from a
252
268
control group hierarchy all its processes will be moved to the
469
485
equal to the empty string the state of the initrd's system
470
486
manager process is passed to the main system manager, which
471
487
allows later introspection of the state of the services
472
involved in the initrd boot.</p></dd></dl></div></div><div class="refsect1"><a name="idp5244000"></a><h2>Exit status</h2><p>On success 0 is returned, a non-zero failure
473
code otherwise.</p></div><div class="refsect1"><a name="idp5245232"></a><h2>Environment</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="varname">$SYSTEMD_PAGER</code></span></dt><dd><p>Pager to use when <code class="option">--no-pager</code> is not
488
involved in the initrd boot.</p></dd></dl></div></div><div class="refsect1"><a name="idp4954624"></a><h2>Exit status</h2><p>On success 0 is returned, a non-zero failure
489
code otherwise.</p></div><div class="refsect1"><a name="idp4955856"></a><h2>Environment</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="varname">$SYSTEMD_PAGER</code></span></dt><dd><p>Pager to use when <code class="option">--no-pager</code> is not
474
490
given; overrides <code class="varname">$PAGER</code>. Setting this to
475
491
an empty string or the value <code class="literal">cat</code> is
476
492
equivalent to passing
477
<code class="option">--no-pager</code>.</p></dd></dl></div></div><div class="refsect1"><a name="idp5250144"></a><h2>See Also</h2><p>
493
<code class="option">--no-pager</code>.</p></dd></dl></div></div><div class="refsect1"><a name="idp4960768"></a><h2>See Also</h2><p>
478
494
<a href="systemd.html"><span class="citerefentry"><span class="refentrytitle">systemd</span>(1)</span></a>,
479
495
<a href="systemadm.html"><span class="citerefentry"><span class="refentrytitle">systemadm</span>(1)</span></a>,
480
496
<a href="journalctl.html"><span class="citerefentry"><span class="refentrytitle">journalctl</span>(1)</span></a>,