]> git.proxmox.com Git - systemd.git/blob - man/systemctl.html
Imported Upstream version 218
[systemd.git] / man / systemctl.html
1 <html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>systemctl</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><style>
2 a.headerlink {
3 color: #c60f0f;
4 font-size: 0.8em;
5 padding: 0 4px 0 4px;
6 text-decoration: none;
7 visibility: hidden;
8 }
9
10 a.headerlink:hover {
11 background-color: #c60f0f;
12 color: white;
13 }
14
15 h1:hover > a.headerlink, h2:hover > a.headerlink, h3:hover > a.headerlink, dt:hover > a.headerlink {
16 visibility: visible;
17 }
18 </style><a href="index.html">Index </a>·
19 <a href="systemd.directives.html">Directives </a>·
20 <a href="../python-systemd/index.html">Python </a>·
21 <a href="../libudev/index.html">libudev </a>·
22 <a href="../libudev/index.html">gudev </a><span style="float:right">systemd 218</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="idm140128984173728"></a><h2 id="Description">Description<a class="headerlink" title="Permalink to this headline" href="#Description"></a></h2><p><span class="command"><strong>systemctl</strong></span> may be used to introspect and
23 control the state of the "<code class="literal">systemd</code>" system and
24 service manager. Please refer to
25 <a href="systemd.html"><span class="citerefentry"><span class="refentrytitle">systemd</span>(1)</span></a>
26 for an introduction into the basic concepts and functionality this
27 tool manages.</p></div><div class="refsect1"><a name="idm140128984243056"></a><h2 id="Options">Options<a class="headerlink" title="Permalink to this headline" href="#Options"></a></h2><p>The following options are understood:</p><div class="variablelist"><dl class="variablelist"><dt id="-t"><span class="term"><code class="option">-t</code>, </span><span class="term"><code class="option">--type=</code></span><a class="headerlink" title="Permalink to this term" href="#-t"></a></dt><dd><p>The argument should be a comma-separated list of unit
28 types such as <code class="option">service</code> and
29 <code class="option">socket</code>.
30 </p><p>If one of the arguments is a unit type, when listing
31 units, limit display to certain unit types. Otherwise, units
32 of all types will be shown.</p><p>As a special case, if one of the arguments is
33 <code class="option">help</code>, a list of allowed values will be
34 printed and the program will exit.</p></dd><dt id="--state="><span class="term"><code class="option">--state=</code></span><a class="headerlink" title="Permalink to this term" href="#--state="></a></dt><dd><p>The argument should be a comma-separated list of unit
35 LOAD, SUB, or ACTIVE states. When listing units, show only
36 those in specified states. Use <code class="option">--state=failed</code>
37 to show only failed units.</p></dd><dt id="-p"><span class="term"><code class="option">-p</code>, </span><span class="term"><code class="option">--property=</code></span><a class="headerlink" title="Permalink to this term" href="#-p"></a></dt><dd><p>When showing unit/job/manager properties with the
38 <span class="command"><strong>show</strong></span> command, limit display to certain
39 properties as specified as argument. If not specified, all
40 set properties are shown. The argument should be a
41 comma-separated list of property names, such as
42 "<code class="literal">MainPID</code>". If specified more than once, all
43 properties with the specified names are shown.</p></dd><dt id="-a"><span class="term"><code class="option">-a</code>, </span><span class="term"><code class="option">--all</code></span><a class="headerlink" title="Permalink to this term" href="#-a"></a></dt><dd><p>When listing units, show all loaded units, regardless
44 of their state, including inactive units. When showing
45 unit/job/manager properties, show all properties regardless
46 whether they are set or not.</p><p>To list all units installed on the system, use the
47 <span class="command"><strong>list-unit-files</strong></span> command instead.</p></dd><dt id="-r"><span class="term"><code class="option">-r</code>, </span><span class="term"><code class="option">--recursive</code></span><a class="headerlink" title="Permalink to this term" href="#-r"></a></dt><dd><p>When listing units, also show units of local
48 containers. Units of local containers will be prefixed with
49 the container name, separated by a single colon character
50 ("<code class="literal">:</code>").</p></dd><dt id="--reverse"><span class="term"><code class="option">--reverse</code></span><a class="headerlink" title="Permalink to this term" href="#--reverse"></a></dt><dd><p>Show reverse dependencies between units with
51 <span class="command"><strong>list-dependencies</strong></span>, i.e. follow
52 dependencies of type <code class="varname">WantedBy=</code>,
53 <code class="varname">RequiredBy=</code>,
54 <code class="varname">RequiredByOverrridable=</code>,
55 <code class="varname">PartOf=</code>, <code class="varname">BoundBy=</code>,
56 instead of <code class="varname">Wants=</code> and similar.
57 </p></dd><dt id="--after"><span class="term"><code class="option">--after</code></span><a class="headerlink" title="Permalink to this term" href="#--after"></a></dt><dd><p>With <span class="command"><strong>list-dependencies</strong></span>, show the
58 units that are ordered before the specified unit. In other
59 words, recursively list units following the
60 <code class="varname">After=</code> dependency.</p><p>Note that any <code class="varname">After=</code> dependency is
61 automatically mirrored to create a
62 <code class="varname">Before=</code> dependency. Temporal dependencies
63 may be specified explictly, but are also created implicitly
64 for units which are <code class="varname">WantedBy=</code> targets
65 (see
66 <a href="systemd.target.html"><span class="citerefentry"><span class="refentrytitle">systemd.target</span>(5)</span></a>),
67 and as a result of other directives (for example
68 <code class="varname">RequiresMountsFor=</code>). Both explicitly
69 and implicitly introduced dependencies are shown with
70 <span class="command"><strong>list-dependencies</strong></span>.</p></dd><dt id="--before"><span class="term"><code class="option">--before</code></span><a class="headerlink" title="Permalink to this term" href="#--before"></a></dt><dd><p>With <span class="command"><strong>list-dependencies</strong></span>, show the
71 units that are ordered after the specified unit. In other
72 words, recursively list units following the
73 <code class="varname">Before=</code> dependency.</p></dd><dt id="-l"><span class="term"><code class="option">-l</code>, </span><span class="term"><code class="option">--full</code></span><a class="headerlink" title="Permalink to this term" href="#-l"></a></dt><dd><p>Do not ellipsize unit names, process tree entries,
74 journal output, or truncate unit descriptions in the output
75 of <span class="command"><strong>status</strong></span>, <span class="command"><strong>list-units</strong></span>,
76 <span class="command"><strong>list-jobs</strong></span>, and
77 <span class="command"><strong>list-timers</strong></span>.</p></dd><dt id="--show-types"><span class="term"><code class="option">--show-types</code></span><a class="headerlink" title="Permalink to this term" href="#--show-types"></a></dt><dd><p>When showing sockets, show the type of the socket.</p></dd><dt id="--job-mode="><span class="term"><code class="option">--job-mode=</code></span><a class="headerlink" title="Permalink to this term" href="#--job-mode="></a></dt><dd><p>When queuing a new job, this option controls how to deal with
78 already queued jobs. It takes one of "<code class="literal">fail</code>",
79 "<code class="literal">replace</code>",
80 "<code class="literal">replace-irreversibly</code>",
81 "<code class="literal">isolate</code>",
82 "<code class="literal">ignore-dependencies</code>",
83 "<code class="literal">ignore-requirements</code>" or
84 "<code class="literal">flush</code>". Defaults to
85 "<code class="literal">replace</code>", except when the
86 <span class="command"><strong>isolate</strong></span> command is used which implies the
87 "<code class="literal">isolate</code>" job mode.</p><p>If "<code class="literal">fail</code>" is specified and a requested
88 operation conflicts with a pending job (more specifically:
89 causes an already pending start job to be reversed into a stop
90 job or vice versa), cause the operation to fail.</p><p>If "<code class="literal">replace</code>" (the default) is
91 specified, any conflicting pending job will be replaced, as
92 necessary.</p><p>If "<code class="literal">replace-irreversibly</code>" is specified,
93 operate like "<code class="literal">replace</code>", but also mark the new
94 jobs as irreversible. This prevents future conflicting
95 transactions from replacing these jobs (or even being enqueued
96 while the irreversible jobs are still pending). Irreversible
97 jobs can still be cancelled using the <span class="command"><strong>cancel</strong></span>
98 command.</p><p>"<code class="literal">isolate</code>" is only valid for start
99 operations and causes all other units to be stopped when the
100 specified unit is started. This mode is always used when the
101 <span class="command"><strong>isolate</strong></span> command is used.</p><p>"<code class="literal">flush</code>" will cause all queued jobs to
102 be canceled when the new job is enqueued.</p><p>If "<code class="literal">ignore-dependencies</code>" is specified,
103 then all unit dependencies are ignored for this new job and
104 the operation is executed immediately. If passed, no required
105 units of the unit passed will be pulled in, and no ordering
106 dependencies will be honored. This is mostly a debugging and
107 rescue tool for the administrator and should not be used by
108 applications.</p><p>"<code class="literal">ignore-requirements</code>" is similar to
109 "<code class="literal">ignore-dependencies</code>", but only causes the
110 requirement dependencies to be ignored, the ordering
111 dependencies will still be honoured.</p></dd><dt id="-i"><span class="term"><code class="option">-i</code>, </span><span class="term"><code class="option">--ignore-inhibitors</code></span><a class="headerlink" title="Permalink to this term" href="#-i"></a></dt><dd><p>When system shutdown or a sleep state is requested,
112 ignore inhibitor locks. Applications can establish inhibitor
113 locks to avoid that certain important operations (such as CD
114 burning or suchlike) are interrupted by system shutdown or a
115 sleep state. Any user may take these locks and privileged
116 users may override these locks. If any locks are taken,
117 shutdown and sleep state requests will normally fail
118 (regardless of whether privileged or not) and a list of active locks
119 is printed. However, if <code class="option">--ignore-inhibitors</code>
120 is specified, the locks are ignored and not printed, and the
121 operation attempted anyway, possibly requiring additional
122 privileges.</p></dd><dt id="-q"><span class="term"><code class="option">-q</code>, </span><span class="term"><code class="option">--quiet</code></span><a class="headerlink" title="Permalink to this term" href="#-q"></a></dt><dd><p>Suppress output to standard output in
123 <span class="command"><strong>snapshot</strong></span>,
124 <span class="command"><strong>is-active</strong></span>,
125 <span class="command"><strong>is-failed</strong></span>,
126 <span class="command"><strong>is-enabled</strong></span>,
127 <span class="command"><strong>is-system-running</strong></span>,
128 <span class="command"><strong>enable</strong></span> and
129 <span class="command"><strong>disable</strong></span>.</p></dd><dt id="--no-block"><span class="term"><code class="option">--no-block</code></span><a class="headerlink" title="Permalink to this term" href="#--no-block"></a></dt><dd><p>Do not synchronously wait for the requested operation
130 to finish. If this is not specified, the job will be
131 verified, enqueued and <span class="command"><strong>systemctl</strong></span> will
132 wait until it is completed. By passing this argument, it is
133 only verified and enqueued.</p></dd><dt id="--no-legend"><span class="term"><code class="option">--no-legend</code></span><a class="headerlink" title="Permalink to this term" href="#--no-legend"></a></dt><dd><p>Do not print the legend, i.e. the column headers and
134 the footer with hints.</p></dd><dt id="--user"><span class="term"><code class="option">--user</code></span><a class="headerlink" title="Permalink to this term" href="#--user"></a></dt><dd><p><a name="user-text"></a>Talk to the service manager of the calling user,
135 rather than the service manager of the system.</p></dd><dt id="--system"><span class="term"><code class="option">--system</code></span><a class="headerlink" title="Permalink to this term" href="#--system"></a></dt><dd><p><a name="system-text"></a>Talk to the service manager of the system. This is the
136 implied default.</p></dd><dt id="--no-wall"><span class="term"><code class="option">--no-wall</code></span><a class="headerlink" title="Permalink to this term" href="#--no-wall"></a></dt><dd><p>Do not send wall message before halt, power-off,
137 reboot.</p></dd><dt id="--global"><span class="term"><code class="option">--global</code></span><a class="headerlink" title="Permalink to this term" href="#--global"></a></dt><dd><p>When used with <span class="command"><strong>enable</strong></span> and
138 <span class="command"><strong>disable</strong></span>, operate on the global user
139 configuration directory, thus enabling or disabling a unit
140 file globally for all future logins of all users.</p></dd><dt id="--no-reload"><span class="term"><code class="option">--no-reload</code></span><a class="headerlink" title="Permalink to this term" href="#--no-reload"></a></dt><dd><p>When used with <span class="command"><strong>enable</strong></span> and
141 <span class="command"><strong>disable</strong></span>, do not implicitly reload daemon
142 configuration after executing the changes.</p></dd><dt id="--no-ask-password"><span class="term"><code class="option">--no-ask-password</code></span><a class="headerlink" title="Permalink to this term" href="#--no-ask-password"></a></dt><dd><p>When used with <span class="command"><strong>start</strong></span> and related
143 commands, disables asking for passwords. Background services
144 may require input of a password or passphrase string, for
145 example to unlock system hard disks or cryptographic
146 certificates. Unless this option is specified and the
147 command is invoked from a terminal,
148 <span class="command"><strong>systemctl</strong></span> will query the user on the
149 terminal for the necessary secrets. Use this option to
150 switch this behavior off. In this case, the password must be
151 supplied by some other means (for example graphical password
152 agents) or the service might fail. This also disables
153 querying the user for authentication for privileged
154 operations.</p></dd><dt id="--kill-who="><span class="term"><code class="option">--kill-who=</code></span><a class="headerlink" title="Permalink to this term" href="#--kill-who="></a></dt><dd><p>When used with <span class="command"><strong>kill</strong></span>, choose which
155 processes to send a signal to. Must be one of
156 <code class="option">main</code>, <code class="option">control</code> or
157 <code class="option">all</code> to select whether to kill only the main
158 process, the control process or all processes of the
159 unit. The main process of the unit is the one that defines
160 the life-time of it. A control process of a unit is one that
161 is invoked by the manager to induce state changes of it. For
162 example, all processes started due to the
163 <code class="varname">ExecStartPre=</code>,
164 <code class="varname">ExecStop=</code> or
165 <code class="varname">ExecReload=</code> settings of service units are
166 control processes. Note that there is only one control
167 process per unit at a time, as only one state change is
168 executed at a time. For services of type
169 <code class="varname">Type=forking</code>, the initial process started
170 by the manager for <code class="varname">ExecStart=</code> is a
171 control process, while the process ultimately forked off by
172 that one is then considered the main process of the unit (if
173 it can be determined). This is different for service units
174 of other types, where the process forked off by the manager
175 for <code class="varname">ExecStart=</code> is always the main process
176 itself. A service unit consists of zero or one main process,
177 zero or one control process plus any number of additional
178 processes. Not all unit types manage processes of these
179 types however. For example, for mount units, control processes
180 are defined (which are the invocations of
181 <code class="filename">/usr/bin/mount</code> and
182 <code class="filename">/usr/bin/umount</code>), but no main process
183 is defined. If omitted, defaults to
184 <code class="option">all</code>.</p></dd><dt id="-s"><span class="term"><code class="option">-s</code>, </span><span class="term"><code class="option">--signal=</code></span><a class="headerlink" title="Permalink to this term" href="#-s"></a></dt><dd><p>When used with <span class="command"><strong>kill</strong></span>, choose which
185 signal to send to selected processes. Must be one of the
186 well known signal specifiers such as <code class="constant">SIGTERM</code>, <code class="constant">SIGINT</code> or
187 <code class="constant">SIGSTOP</code>. If omitted, defaults to
188 <code class="option">SIGTERM</code>.</p></dd><dt id="-f"><span class="term"><code class="option">-f</code>, </span><span class="term"><code class="option">--force</code></span><a class="headerlink" title="Permalink to this term" href="#-f"></a></dt><dd><p>When used with <span class="command"><strong>enable</strong></span>, overwrite
189 any existing conflicting symlinks.</p><p>When used with <span class="command"><strong>halt</strong></span>,
190 <span class="command"><strong>poweroff</strong></span>, <span class="command"><strong>reboot</strong></span> or
191 <span class="command"><strong>kexec</strong></span>, execute the selected operation
192 without shutting down all units. However, all processes will
193 be killed forcibly and all file systems are unmounted or
194 remounted read-only. This is hence a drastic but relatively
195 safe option to request an immediate reboot. If
196 <code class="option">--force</code> is specified twice for these
197 operations, they will be executed immediately without
198 terminating any processes or unmounting any file
199 systems. Warning: specifying <code class="option">--force</code> twice
200 with any of these operations might result in data
201 loss.</p></dd><dt id="--root="><span class="term"><code class="option">--root=</code></span><a class="headerlink" title="Permalink to this term" href="#--root="></a></dt><dd><p>When used with
202 <span class="command"><strong>enable</strong></span>/<span class="command"><strong>disable</strong></span>/<span class="command"><strong>is-enabled</strong></span>
203 (and related commands), use alternative root path when
204 looking for unit files.</p></dd><dt id="--runtime"><span class="term"><code class="option">--runtime</code></span><a class="headerlink" title="Permalink to this term" href="#--runtime"></a></dt><dd><p>When used with <span class="command"><strong>enable</strong></span>,
205 <span class="command"><strong>disable</strong></span>, <span class="command"><strong>edit</strong></span>,
206 (and related commands), make changes only temporarily, so
207 that they are lost on the next reboot. This will have the
208 effect that changes are not made in subdirectories of
209 <code class="filename">/etc</code> but in <code class="filename">/run</code>,
210 with identical immediate effects, however, since the latter
211 is lost on reboot, the changes are lost too.</p><p>Similarly, when used with
212 <span class="command"><strong>set-property</strong></span>, make changes only
213 temporarily, so that they are lost on the next
214 reboot.</p></dd><dt id="--preset-mode="><span class="term"><code class="option">--preset-mode=</code></span><a class="headerlink" title="Permalink to this term" href="#--preset-mode="></a></dt><dd><p>Takes one of "<code class="literal">full</code>" (the default),
215 "<code class="literal">enable-only</code>",
216 "<code class="literal">disable-only</code>". When used with the
217 <span class="command"><strong>preset</strong></span> or <span class="command"><strong>preset-all</strong></span>
218 commands, controls whether units shall be disabled and
219 enabled according to the preset rules, or only enabled, or
220 only disabled.</p></dd><dt id="-n"><span class="term"><code class="option">-n</code>, </span><span class="term"><code class="option">--lines=</code></span><a class="headerlink" title="Permalink to this term" href="#-n"></a></dt><dd><p>When used with <span class="command"><strong>status</strong></span>, controls the
221 number of journal lines to show, counting from the most
222 recent ones. Takes a positive integer argument. Defaults to
223 10.</p></dd><dt id="-o"><span class="term"><code class="option">-o</code>, </span><span class="term"><code class="option">--output=</code></span><a class="headerlink" title="Permalink to this term" href="#-o"></a></dt><dd><p>When used with <span class="command"><strong>status</strong></span>, controls the
224 formatting of the journal entries that are shown. For the
225 available choices, see
226 <a href="journalctl.html"><span class="citerefentry"><span class="refentrytitle">journalctl</span>(1)</span></a>.
227 Defaults to "<code class="literal">short</code>".</p></dd><dt id="--plain"><span class="term"><code class="option">--plain</code></span><a class="headerlink" title="Permalink to this term" href="#--plain"></a></dt><dd><p>When used with <span class="command"><strong>list-dependencies</strong></span>,
228 the output is printed as a list instead of a tree.</p></dd><dt id="-H"><span class="term"><code class="option">-H</code>, </span><span class="term"><code class="option">--host=</code></span><a class="headerlink" title="Permalink to this term" href="#-H"></a></dt><dd><p><a name="host-text"></a>Execute the operation remotely. Specify a hostname, or a
229 username and hostname separated by "<code class="literal">@</code>", to
230 connect to. The hostname may optionally be suffixed by a
231 container name, separated by "<code class="literal">:</code>", which
232 connects directly to a specific container on the specified
233 host. This will use SSH to talk to the remote machine manager
234 instance. Container names may be enumerated with
235 <span class="command"><strong>machinectl -H
236 <em class="replaceable"><code>HOST</code></em></strong></span>.</p></dd><dt id="-M"><span class="term"><code class="option">-M</code>, </span><span class="term"><code class="option">--machine=</code></span><a class="headerlink" title="Permalink to this term" href="#-M"></a></dt><dd><p><a name="machine-text"></a>Execute operation on a local container. Specify a
237 container name to connect to.</p></dd><dt id="-h"><span class="term"><code class="option">-h</code>, </span><span class="term"><code class="option">--help</code></span><a class="headerlink" title="Permalink to this term" href="#-h"></a></dt><dd><p><a name="help-text"></a>Print a short help text and exit.
238 </p></dd><dt id="--version"><span class="term"><code class="option">--version</code></span><a class="headerlink" title="Permalink to this term" href="#--version"></a></dt><dd><p><a name="version-text"></a>Print a short version string and exit.</p></dd><dt id="--no-pager"><span class="term"><code class="option">--no-pager</code></span><a class="headerlink" title="Permalink to this term" href="#--no-pager"></a></dt><dd><p>Do not pipe output into a pager.</p></dd></dl></div></div><div class="refsect1"><a name="idm140128979497200"></a><h2 id="Commands">Commands<a class="headerlink" title="Permalink to this headline" href="#Commands"></a></h2><p>The following commands are understood:</p><div class="refsect2"><a name="idm140128979496176"></a><h3 id="Unit Commands">Unit Commands<a class="headerlink" title="Permalink to this headline" href="#Unit%20Commands"></a></h3><div class="variablelist"><dl class="variablelist"><dt id="list-units PATTERN..."><span class="term"><span class="command"><strong>list-units [<span class="optional"><em class="replaceable"><code>PATTERN</code></em>...</span>]</strong></span></span><a class="headerlink" title="Permalink to this term" href="#list-units%20PATTERN..."></a></dt><dd><p>List known units (subject to limitations specified
239 with <code class="option">-t</code>). If one or more
240 <em class="replaceable"><code>PATTERN</code></em>s are specified, only
241 units matching one of them are shown.</p><p>This is the default command.</p></dd><dt id="list-sockets PATTERN..."><span class="term"><span class="command"><strong>list-sockets [<span class="optional"><em class="replaceable"><code>PATTERN</code></em>...</span>]</strong></span></span><a class="headerlink" title="Permalink to this term" href="#list-sockets%20PATTERN..."></a></dt><dd><p>List socket units ordered by listening address.
242 If one or more <em class="replaceable"><code>PATTERN</code></em>s are
243 specified, only socket units matching one of them are
244 shown. Produces output similar to
245 </p><pre class="programlisting">
246 LISTEN UNIT ACTIVATES
247 /dev/initctl systemd-initctl.socket systemd-initctl.service
248 ...
249 [::]:22 sshd.socket sshd.service
250 kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service
251
252 5 sockets listed.</pre><p>
253 Note: because the addresses might contains spaces, this output
254 is not suitable for programmatic consumption.
255 </p><p>See also the options <code class="option">--show-types</code>,
256 <code class="option">--all</code>, and <code class="option">--state=</code>.</p></dd><dt id="list-timers PATTERN..."><span class="term"><span class="command"><strong>list-timers [<span class="optional"><em class="replaceable"><code>PATTERN</code></em>...</span>]</strong></span></span><a class="headerlink" title="Permalink to this term" href="#list-timers%20PATTERN..."></a></dt><dd><p>List timer units ordered by the time they elapse
257 next. If one or more <em class="replaceable"><code>PATTERN</code></em>s
258 are specified, only units matching one of them are shown.
259 </p><p>See also the options <code class="option">--all</code> and
260 <code class="option">--state=</code>.</p></dd><dt id="start PATTERN..."><span class="term"><span class="command"><strong>start <em class="replaceable"><code>PATTERN</code></em>...</strong></span></span><a class="headerlink" title="Permalink to this term" href="#start%20PATTERN..."></a></dt><dd><p>Start (activate) one or more units specified on the
261 command line.</p><p>Note that glob patterns operate on a list of currently
262 loaded units. Units which are not active and are not in a
263 failed state usually are not loaded, and would not be
264 matched by any pattern. In addition, in case of
265 instantiated units, systemd is often unaware of the
266 instance name until the instance has been started. Therefore,
267 using glob patterns with <span class="command"><strong>start</strong></span>
268 has limited usefulness.</p></dd><dt id="stop PATTERN..."><span class="term"><span class="command"><strong>stop <em class="replaceable"><code>PATTERN</code></em>...</strong></span></span><a class="headerlink" title="Permalink to this term" href="#stop%20PATTERN..."></a></dt><dd><p>Stop (deactivate) one or more units specified on the
269 command line.</p></dd><dt id="reload PATTERN..."><span class="term"><span class="command"><strong>reload <em class="replaceable"><code>PATTERN</code></em>...</strong></span></span><a class="headerlink" title="Permalink to this term" href="#reload%20PATTERN..."></a></dt><dd><p>Asks all units listed on the command line to reload
270 their configuration. Note that this will reload the
271 service-specific configuration, not the unit configuration
272 file of systemd. If you want systemd to reload the
273 configuration file of a unit, use the
274 <span class="command"><strong>daemon-reload</strong></span> command. In other words:
275 for the example case of Apache, this will reload Apache's
276 <code class="filename">httpd.conf</code> in the web server, not the
277 <code class="filename">apache.service</code> systemd unit
278 file.</p><p>This command should not be confused with the
279 <span class="command"><strong>daemon-reload</strong></span> command.</p></dd><dt id="restart PATTERN..."><span class="term"><span class="command"><strong>restart <em class="replaceable"><code>PATTERN</code></em>...</strong></span></span><a class="headerlink" title="Permalink to this term" href="#restart%20PATTERN..."></a></dt><dd><p>Restart one or more units specified on the command
280 line. If the units are not running yet, they will be
281 started.</p></dd><dt id="try-restart PATTERN..."><span class="term"><span class="command"><strong>try-restart <em class="replaceable"><code>PATTERN</code></em>...</strong></span></span><a class="headerlink" title="Permalink to this term" href="#try-restart%20PATTERN..."></a></dt><dd><p>Restart one or more units specified on the command
282 line if the units are running. This does nothing if units are not
283 running. Note that, for compatibility with Red Hat init
284 scripts, <span class="command"><strong>condrestart</strong></span> is equivalent to this
285 command.</p></dd><dt id="reload-or-restart PATTERN..."><span class="term"><span class="command"><strong>reload-or-restart <em class="replaceable"><code>PATTERN</code></em>...</strong></span></span><a class="headerlink" title="Permalink to this term" href="#reload-or-restart%20PATTERN..."></a></dt><dd><p>Reload one or more units if they support it. If not,
286 restart them instead. If the units are not running yet, they
287 will be started.</p></dd><dt id="reload-or-try-restart PATTERN..."><span class="term"><span class="command"><strong>reload-or-try-restart <em class="replaceable"><code>PATTERN</code></em>...</strong></span></span><a class="headerlink" title="Permalink to this term" href="#reload-or-try-restart%20PATTERN..."></a></dt><dd><p>Reload one or more units if they support it. If not,
288 restart them instead. This does nothing if the units are not
289 running. Note that, for compatibility with SysV init scripts,
290 <span class="command"><strong>force-reload</strong></span> is equivalent to this
291 command.</p></dd><dt id="isolate NAME"><span class="term"><span class="command"><strong>isolate <em class="replaceable"><code>NAME</code></em></strong></span></span><a class="headerlink" title="Permalink to this term" href="#isolate%20NAME"></a></dt><dd><p>Start the unit specified on the command line and its
292 dependencies and stop all others. If a unit name with no
293 extension is given, an extension of
294 "<code class="literal">.target</code>" will be assumed.</p><p>This is similar to changing the runlevel in a
295 traditional init system. The <span class="command"><strong>isolate</strong></span>
296 command will immediately stop processes that are not enabled
297 in the new unit, possibly including the graphical
298 environment or terminal you are currently using.</p><p>Note that this is allowed only on units where
299 <code class="option">AllowIsolate=</code> is enabled. See
300 <a href="systemd.unit.html"><span class="citerefentry"><span class="refentrytitle">systemd.unit</span>(5)</span></a>
301 for details.</p></dd><dt id="kill PATTERN..."><span class="term"><span class="command"><strong>kill <em class="replaceable"><code>PATTERN</code></em>...</strong></span></span><a class="headerlink" title="Permalink to this term" href="#kill%20PATTERN..."></a></dt><dd><p>Send a signal to one or more processes of the
302 unit. Use <code class="option">--kill-who=</code> to select which
303 process to kill. Use <code class="option">--signal=</code> to select
304 the signal to send.</p></dd><dt id="is-active PATTERN..."><span class="term"><span class="command"><strong>is-active <em class="replaceable"><code>PATTERN</code></em>...</strong></span></span><a class="headerlink" title="Permalink to this term" href="#is-active%20PATTERN..."></a></dt><dd><p>Check whether any of the specified units are active
305 (i.e. running). Returns an exit code
306 <code class="constant">0</code> if at least one is active, or
307 non-zero otherwise. Unless <code class="option">--quiet</code> is
308 specified, this will also print the current unit state to
309 standard output.</p></dd><dt id="is-failed PATTERN..."><span class="term"><span class="command"><strong>is-failed <em class="replaceable"><code>PATTERN</code></em>...</strong></span></span><a class="headerlink" title="Permalink to this term" href="#is-failed%20PATTERN..."></a></dt><dd><p>Check whether any of the specified units are in a
310 "failed" state. Returns an exit code
311 <code class="constant">0</code> if at least one has failed,
312 non-zero otherwise. Unless <code class="option">--quiet</code> is
313 specified, this will also print the current unit state to
314 standard output.</p></dd><dt id="status PATTERN...|PID...]"><span class="term"><span class="command"><strong>status</strong></span> [<span class="optional"><em class="replaceable"><code>PATTERN</code></em>...|<em class="replaceable"><code>PID</code></em>...]</span>]</span><a class="headerlink" title="Permalink to this term" href="#status%20PATTERN...%7CPID...%5D"></a></dt><dd><p>Show terse runtime status information about one or
315 more units, followed by most recent log data from the
316 journal. If no units are specified, show system status. If
317 combined with <code class="option">--all</code>, also show the status of
318 all units (subject to limitations specified with
319 <code class="option">-t</code>). If a PID is passed, show information
320 about the unit the process belongs to.</p><p>This function is intended to generate human-readable
321 output. If you are looking for computer-parsable output,
322 use <span class="command"><strong>show</strong></span> instead. By default this
323 function only shows 10 lines of output and ellipsizes
324 lines to fit in the terminal window. This can be changes
325 with <code class="option">--lines</code> and <code class="option">--full</code>,
326 see above. In addition, <span class="command"><strong>journalctl
327 --unit=<em class="replaceable"><code>NAME</code></em></strong></span> or
328 <span class="command"><strong>journalctl
329 --user-unit=<em class="replaceable"><code>NAME</code></em></strong></span> use
330 a similar filter for messages and might be more
331 convenient.
332 </p></dd><dt id="show PATTERN...|JOB..."><span class="term"><span class="command"><strong>show</strong></span> [<span class="optional"><em class="replaceable"><code>PATTERN</code></em>...|<em class="replaceable"><code>JOB</code></em>...</span>]</span><a class="headerlink" title="Permalink to this term" href="#show%20PATTERN...%7CJOB..."></a></dt><dd><p>Show properties of one or more units, jobs, or the
333 manager itself. If no argument is specified, properties of
334 the manager will be shown. If a unit name is specified,
335 properties of the unit is shown, and if a job id is
336 specified, properties of the job is shown. By default, empty
337 properties are suppressed. Use <code class="option">--all</code> to
338 show those too. To select specific properties to show, use
339 <code class="option">--property=</code>. This command is intended to be
340 used whenever computer-parsable output is required. Use
341 <span class="command"><strong>status</strong></span> if you are looking for formatted
342 human-readable output.</p></dd><dt id="cat PATTERN..."><span class="term"><span class="command"><strong>cat <em class="replaceable"><code>PATTERN</code></em>...</strong></span></span><a class="headerlink" title="Permalink to this term" href="#cat%20PATTERN..."></a></dt><dd><p>Show backing files of one or more units. Prints the
343 "fragment" and "drop-ins" (source files) of units. Each
344 file is preceded by a comment which includes the file
345 name.</p></dd><dt id="set-property NAME ASSIGNMENT..."><span class="term"><span class="command"><strong>set-property <em class="replaceable"><code>NAME</code></em> <em class="replaceable"><code>ASSIGNMENT</code></em>...</strong></span></span><a class="headerlink" title="Permalink to this term" href="#set-property%20NAME%20ASSIGNMENT..."></a></dt><dd><p>Set the specified unit properties at runtime where
346 this is supported. This allows changing configuration
347 parameter properties such as resource control settings at
348 runtime. Not all properties may be changed at runtime, but
349 many resource control settings (primarily those in
350 <a href="systemd.resource-control.html"><span class="citerefentry"><span class="refentrytitle">systemd.resource-control</span>(5)</span></a>)
351 may. The changes are applied instantly, and stored on disk
352 for future boots, unless <code class="option">--runtime</code> is
353 passed, in which case the settings only apply until the
354 next reboot. The syntax of the property assignment follows
355 closely the syntax of assignments in unit files.</p><p>Example: <span class="command"><strong>systemctl set-property foobar.service CPUShares=777</strong></span></p><p>Note that this command allows changing multiple
356 properties at the same time, which is preferable over
357 setting them individually. Like unit file configuration
358 settings, assigning the empty list to list parameters will
359 reset the list.</p></dd><dt id="help PATTERN...|PID..."><span class="term"><span class="command"><strong>help <em class="replaceable"><code>PATTERN</code></em>...|<em class="replaceable"><code>PID</code></em>...</strong></span></span><a class="headerlink" title="Permalink to this term" href="#help%20PATTERN...%7CPID..."></a></dt><dd><p>Show manual pages for one or more units, if
360 available. If a PID is given, the manual pages for the unit
361 the process belongs to are shown.</p></dd><dt id="reset-failed [PATTERN...]"><span class="term"><span class="command"><strong>reset-failed [<em class="replaceable"><code>PATTERN</code></em>...]</strong></span></span><a class="headerlink" title="Permalink to this term" href="#reset-failed%20%5BPATTERN...%5D"></a></dt><dd><p>Reset the "<code class="literal">failed</code>" state of the
362 specified units, or if no unit name is passed, reset the state of all
363 units. When a unit fails in some way (i.e. process exiting
364 with non-zero error code, terminating abnormally or timing
365 out), it will automatically enter the
366 "<code class="literal">failed</code>" state and its exit code and status
367 is recorded for introspection by the administrator until the
368 service is restarted or reset with this command.</p></dd><dt id="
369 list-dependencies
370 NAME
371 "><span class="term">
372 <span class="command"><strong>list-dependencies</strong></span>
373 [<span class="optional"><em class="replaceable"><code>NAME</code></em></span>]
374 </span><a class="headerlink" title="Permalink to this term" href="#%0A%20%20%20%20%20%20%20%20%20%20%20%20list-dependencies%0A%20%20%20%20%20%20%20%20%20%20%20%20NAME%0A%20%20%20%20%20%20%20%20%20%20"></a></dt><dd><p>Shows units required and wanted by the specified
375 unit. This recursively lists units following the
376 <code class="varname">Requires=</code>,
377 <code class="varname">RequiresOverridable=</code>,
378 <code class="varname">Requisite=</code>,
379 <code class="varname">RequisiteOverridable=</code>,
380 <code class="varname">Wants=</code>, <code class="varname">BindsTo=</code>
381 dependencies. If no unit is specified,
382 <code class="filename">default.target</code> is implied.</p><p>By default, only target units are recursively
383 expanded. When <code class="option">--all</code> is passed, all other
384 units are recursively expanded as well.</p><p>Options <code class="option">--reverse</code>,
385 <code class="option">--after</code>, <code class="option">--before</code>
386 may be used to change what types of dependencies
387 are shown.</p></dd></dl></div></div><div class="refsect2"><a name="idm140128979405504"></a><h3 id="Unit File Commands">Unit File Commands<a class="headerlink" title="Permalink to this headline" href="#Unit%20File%20Commands"></a></h3><div class="variablelist"><dl class="variablelist"><dt id="list-unit-files PATTERN..."><span class="term"><span class="command"><strong>list-unit-files [<span class="optional"><em class="replaceable"><code>PATTERN...</code></em></span>]</strong></span></span><a class="headerlink" title="Permalink to this term" href="#list-unit-files%20PATTERN..."></a></dt><dd><p>List installed unit files. If one or more
388 <em class="replaceable"><code>PATTERN</code></em>s are specified, only
389 units whose filename (just the last component of the path)
390 matches one of them are shown.</p></dd><dt id="enable NAME..."><span class="term"><span class="command"><strong>enable <em class="replaceable"><code>NAME</code></em>...</strong></span></span><a class="headerlink" title="Permalink to this term" href="#enable%20NAME..."></a></dt><dd><p>Enable one or more unit files or unit file instances,
391 as specified on the command line. This will create a number
392 of symlinks as encoded in the "<code class="literal">[Install]</code>"
393 sections of the unit files. After the symlinks have been
394 created, the systemd configuration is reloaded (in a way that
395 is equivalent to <span class="command"><strong>daemon-reload</strong></span>) to ensure
396 the changes are taken into account immediately. Note that
397 this does <span class="emphasis"><em>not</em></span> have the effect of also
398 starting any of the units being enabled. If this
399 is desired, a separate <span class="command"><strong>start</strong></span> command must
400 be invoked for the unit. Also note that in case of instance
401 enablement, symlinks named the same as instances are created in
402 the install location, however they all point to the same
403 template unit file.</p><p>This command will print the actions executed. This
404 output may be suppressed by passing <code class="option">--quiet</code>.
405 </p><p>Note that this operation creates only the suggested
406 symlinks for the units. While this command is the
407 recommended way to manipulate the unit configuration
408 directory, the administrator is free to make additional
409 changes manually by placing or removing symlinks in the
410 directory. This is particularly useful to create
411 configurations that deviate from the suggested default
412 installation. In this case, the administrator must make sure
413 to invoke <span class="command"><strong>daemon-reload</strong></span> manually as
414 necessary to ensure the changes are taken into account.
415 </p><p>Enabling units should not be confused with starting
416 (activating) units, as done by the <span class="command"><strong>start</strong></span>
417 command. Enabling and starting units is orthogonal: units
418 may be enabled without being started and started without
419 being enabled. Enabling simply hooks the unit into various
420 suggested places (for example, so that the unit is
421 automatically started on boot or when a particular kind of
422 hardware is plugged in). Starting actually spawns the daemon
423 process (in case of service units), or binds the socket (in
424 case of socket units), and so on.</p><p>Depending on whether <code class="option">--system</code>,
425 <code class="option">--user</code>, <code class="option">--runtime</code>,
426 or <code class="option">--global</code> is specified, this enables the unit
427 for the system, for the calling user only, for only this boot of
428 the system, or for all future logins of all users, or only this
429 boot. Note that in the last case, no systemd daemon
430 configuration is reloaded.</p><p>Using <span class="command"><strong>enable</strong></span> on masked units
431 results in an error.</p></dd><dt id="disable NAME..."><span class="term"><span class="command"><strong>disable <em class="replaceable"><code>NAME</code></em>...</strong></span></span><a class="headerlink" title="Permalink to this term" href="#disable%20NAME..."></a></dt><dd><p>Disables one or more units. This removes all symlinks
432 to the specified unit files from the unit configuration
433 directory, and hence undoes the changes made by
434 <span class="command"><strong>enable</strong></span>. Note however that this removes
435 all symlinks to the unit files (i.e. including manual
436 additions), not just those actually created by
437 <span class="command"><strong>enable</strong></span>. This call implicitly reloads the
438 systemd daemon configuration after completing the disabling
439 of the units. Note that this command does not implicitly
440 stop the units that are being disabled. If this is desired,
441 an additional <span class="command"><strong>stop</strong></span> command should be
442 executed afterwards.</p><p>This command will print the actions executed. This
443 output may be suppressed by passing <code class="option">--quiet</code>.
444 </p><p>This command honors <code class="option">--system</code>,
445 <code class="option">--user</code>, <code class="option">--runtime</code> and
446 <code class="option">--global</code> in a similar way as
447 <span class="command"><strong>enable</strong></span>.</p></dd><dt id="is-enabled NAME..."><span class="term"><span class="command"><strong>is-enabled <em class="replaceable"><code>NAME</code></em>...</strong></span></span><a class="headerlink" title="Permalink to this term" href="#is-enabled%20NAME..."></a></dt><dd><p>Checks whether any of the specified unit files are
448 enabled (as with <span class="command"><strong>enable</strong></span>). Returns an
449 exit code of 0 if at least one is enabled, non-zero
450 otherwise. Prints the current enable status (see table).
451 To suppress this output, use <code class="option">--quiet</code>.
452 </p><div class="table"><a name="idm140128979376704"></a><p class="title"><b>Table 1
453 <span class="command">is-enabled</span> output
454 </b></p><div class="table-contents"><table summary="
455 is-enabled output
456 " border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Printed string</th><th>Meaning</th><th>Return value</th></tr></thead><tbody><tr><td>"<code class="literal">enabled</code>"</td><td rowspan="2">Enabled through a symlink in <code class="filename">.wants</code> directory (permanently or just in <code class="filename">/run</code>).</td><td rowspan="2">0</td></tr><tr><td>"<code class="literal">enabled-runtime</code>"</td></tr><tr><td>"<code class="literal">linked</code>"</td><td rowspan="2">Made available through a symlink to the unit file (permanently or just in <code class="filename">/run</code>).</td><td rowspan="2">1</td></tr><tr><td>"<code class="literal">linked-runtime</code>"</td></tr><tr><td>"<code class="literal">masked</code>"</td><td rowspan="2">Disabled entirely (permanently or just in <code class="filename">/run</code>).</td><td rowspan="2">1</td></tr><tr><td>"<code class="literal">masked-runtime</code>"</td></tr><tr><td>"<code class="literal">static</code>"</td><td>Unit file is not enabled, and has no provisions for enabling in the "<code class="literal">[Install]</code>" section.</td><td>0</td></tr><tr><td>"<code class="literal">indirect</code>"</td><td>Unit file itself is not enabled, but it has a non-empty <code class="varname">Also=</code> setting in the "<code class="literal">[Install]</code>" section, listing other unit files that might be enabled.</td><td>0</td></tr><tr><td>"<code class="literal">disabled</code>"</td><td>Unit file is not enabled.</td><td>1</td></tr></tbody></table></div></div><br class="table-break"></dd><dt id="reenable NAME..."><span class="term"><span class="command"><strong>reenable <em class="replaceable"><code>NAME</code></em>...</strong></span></span><a class="headerlink" title="Permalink to this term" href="#reenable%20NAME..."></a></dt><dd><p>Reenable one or more unit files, as specified on the
457 command line. This is a combination of
458 <span class="command"><strong>disable</strong></span> and <span class="command"><strong>enable</strong></span> and
459 is useful to reset the symlinks a unit is enabled with to
460 the defaults configured in the "<code class="literal">[Install]</code>"
461 section of the unit file.</p></dd><dt id="preset NAME..."><span class="term"><span class="command"><strong>preset <em class="replaceable"><code>NAME</code></em>...</strong></span></span><a class="headerlink" title="Permalink to this term" href="#preset%20NAME..."></a></dt><dd><p>Reset one or more unit files, as specified on the
462 command line, to the defaults configured in the preset
463 policy files. This has the same effect as
464 <span class="command"><strong>disable</strong></span> or <span class="command"><strong>enable</strong></span>,
465 depending how the unit is listed in the preset files.</p><p>Use <code class="option">--preset-mode=</code> to control
466 whether units shall be enabled and disabled, or only
467 enabled, or only disabled.</p><p>For more information on the preset policy format,
468 see
469 <a href="systemd.preset.html"><span class="citerefentry"><span class="refentrytitle">systemd.preset</span>(5)</span></a>.
470 For more information on the concept of presets, please
471 consult the <a class="ulink" href="http://freedesktop.org/wiki/Software/systemd/Preset" target="_top">Preset</a>
472 document.</p></dd><dt id="preset-all"><span class="term"><span class="command"><strong>preset-all</strong></span></span><a class="headerlink" title="Permalink to this term" href="#preset-all"></a></dt><dd><p>Resets all installed unit files to the defaults
473 configured in the preset policy file (see above).</p><p>Use <code class="option">--preset-mode=</code> to control
474 whether units shall be enabled and disabled, or only
475 enabled, or only disabled.</p></dd><dt id="mask NAME..."><span class="term"><span class="command"><strong>mask <em class="replaceable"><code>NAME</code></em>...</strong></span></span><a class="headerlink" title="Permalink to this term" href="#mask%20NAME..."></a></dt><dd><p>Mask one or more unit files, as specified on the
476 command line. This will link these units to
477 <code class="filename">/dev/null</code>, making it impossible to
478 start them. This is a stronger version of
479 <span class="command"><strong>disable</strong></span>, since it prohibits all kinds of
480 activation of the unit, including enablement and manual
481 activation. Use this option with care. This honors the
482 <code class="option">--runtime</code> option to only mask temporarily
483 until the next reboot of the system.</p></dd><dt id="unmask NAME..."><span class="term"><span class="command"><strong>unmask <em class="replaceable"><code>NAME</code></em>...</strong></span></span><a class="headerlink" title="Permalink to this term" href="#unmask%20NAME..."></a></dt><dd><p>Unmask one or more unit files, as specified on the
484 command line. This will undo the effect of
485 <span class="command"><strong>mask</strong></span>.</p></dd><dt id="add-wants TARGET
486 NAME..."><span class="term"><span class="command"><strong>add-wants <em class="replaceable"><code>TARGET</code></em>
487 <em class="replaceable"><code>NAME</code></em>...</strong></span>, </span><span class="term"><span class="command"><strong>add-requires <em class="replaceable"><code>TARGET</code></em>
488 <em class="replaceable"><code>NAME</code></em>...</strong></span></span><a class="headerlink" title="Permalink to this term" href="#add-wants%20TARGET%0A%20%20%20%20%20%20%20%20%20%20NAME..."></a></dt><dd><p>Adds "<code class="literal">Wants=</code>" resp. "<code class="literal">Requires=</code>"
489 dependency to the specified <em class="replaceable"><code>TARGET</code></em> for
490 one or more units. </p><p>This command honors <code class="option">--system</code>,
491 <code class="option">--user</code>, <code class="option">--runtime</code> and
492 <code class="option">--global</code> in a similar way as
493 <span class="command"><strong>enable</strong></span>.</p></dd><dt id="link FILENAME..."><span class="term"><span class="command"><strong>link <em class="replaceable"><code>FILENAME</code></em>...</strong></span></span><a class="headerlink" title="Permalink to this term" href="#link%20FILENAME..."></a></dt><dd><p>Link a unit file that is not in the unit file search
494 paths into the unit file search path. This requires an
495 absolute path to a unit file. The effect of this can be
496 undone with <span class="command"><strong>disable</strong></span>. The effect of this
497 command is that a unit file is available for
498 <span class="command"><strong>start</strong></span> and other commands although it
499 is not installed directly in the unit search path.</p></dd><dt id="get-default"><span class="term"><span class="command"><strong>get-default</strong></span></span><a class="headerlink" title="Permalink to this term" href="#get-default"></a></dt><dd><p>Get the default target specified
500 via <code class="filename">default.target</code> link.</p></dd><dt id="set-default NAME"><span class="term"><span class="command"><strong>set-default <em class="replaceable"><code>NAME</code></em></strong></span></span><a class="headerlink" title="Permalink to this term" href="#set-default%20NAME"></a></dt><dd><p>Set the default target to boot into. Command links
501 <code class="filename">default.target</code> to the given unit.</p></dd><dt id="edit NAME..."><span class="term"><span class="command"><strong>edit <em class="replaceable"><code>NAME</code></em>...</strong></span></span><a class="headerlink" title="Permalink to this term" href="#edit%20NAME..."></a></dt><dd><p>Edit a drop-in snippet or a whole replacement file if
502 <code class="option">--full</code> is specified, to extend or override the
503 specified unit.</p><p>Depending on whether <code class="option">--system</code> (the default),
504 <code class="option">--user</code>, or <code class="option">--global</code> is specified,
505 this creates a drop-in file for each unit either for the system,
506 for the calling user or for all futures logins of all users. Then,
507 the editor (see the "Environment" section below) is invoked on
508 temporary files which will be written to the real location if the
509 editor exits successfully.</p><p>If <code class="option">--full</code> is specified, this will copy the
510 original units instead of creating drop-in files.</p><p>If <code class="option">--runtime</code> is specified, the changes will
511 be made temporarily in <code class="filename">/run</code> and they will be
512 lost on the next reboot.</p><p>If the temporary file is empty upon exit the modification of
513 the related unit is canceled</p><p>After the units have been edited, systemd configuration is
514 reloaded (in a way that is equivalent to <span class="command"><strong>daemon-reload</strong></span>).
515 </p><p>Note that this command cannot be used to remotely edit units
516 and that you cannot temporarily edit units which are in
517 <code class="filename">/etc</code> since they take precedence over
518 <code class="filename">/run</code>.</p></dd></dl></div></div><div class="refsect2"><a name="idm140128979301088"></a><h3 id="Machine Commands">Machine Commands<a class="headerlink" title="Permalink to this headline" href="#Machine%20Commands"></a></h3><div class="variablelist"><dl class="variablelist"><dt id="list-machines PATTERN..."><span class="term"><span class="command"><strong>list-machines [<span class="optional"><em class="replaceable"><code>PATTERN</code></em>...</span>]</strong></span></span><a class="headerlink" title="Permalink to this term" href="#list-machines%20PATTERN..."></a></dt><dd><p>List the host and all running local containers with
519 their state. If one or more
520 <em class="replaceable"><code>PATTERN</code></em>s are specified, only
521 containers matching one of them are shown.
522 </p></dd></dl></div></div><div class="refsect2"><a name="idm140128979296896"></a><h3 id="Job Commands">Job Commands<a class="headerlink" title="Permalink to this headline" href="#Job%20Commands"></a></h3><div class="variablelist"><dl class="variablelist"><dt id="list-jobs PATTERN..."><span class="term"><span class="command"><strong>list-jobs [<span class="optional"><em class="replaceable"><code>PATTERN...</code></em></span>]</strong></span></span><a class="headerlink" title="Permalink to this term" href="#list-jobs%20PATTERN..."></a></dt><dd><p>List jobs that are in progress. If one or more
523 <em class="replaceable"><code>PATTERN</code></em>s are specified, only
524 jobs for units matching one of them are shown.</p></dd><dt id="cancel JOB..."><span class="term"><span class="command"><strong>cancel <em class="replaceable"><code>JOB</code></em>...</strong></span></span><a class="headerlink" title="Permalink to this term" href="#cancel%20JOB..."></a></dt><dd><p>Cancel one or more jobs specified on the command line
525 by their numeric job IDs. If no job ID is specified, cancel
526 all pending jobs.</p></dd></dl></div></div><div class="refsect2"><a name="idm140128979290432"></a><h3 id="Snapshot Commands">Snapshot Commands<a class="headerlink" title="Permalink to this headline" href="#Snapshot%20Commands"></a></h3><div class="variablelist"><dl class="variablelist"><dt id="snapshot NAME"><span class="term"><span class="command"><strong>snapshot [<span class="optional"><em class="replaceable"><code>NAME</code></em></span>]</strong></span></span><a class="headerlink" title="Permalink to this term" href="#snapshot%20NAME"></a></dt><dd><p>Create a snapshot. If a snapshot name is specified,
527 the new snapshot will be named after it. If none is
528 specified, an automatic snapshot name is generated. In
529 either case, the snapshot name used is printed to standard
530 output, unless <code class="option">--quiet</code> is specified.
531 </p><p>A snapshot refers to a saved state of the systemd
532 manager. It is implemented itself as a unit that is
533 generated dynamically with this command and has dependencies
534 on all units active at the time. At a later time, the user
535 may return to this state by using the
536 <span class="command"><strong>isolate</strong></span> command on the snapshot unit.
537 </p><p>Snapshots are only useful for saving and restoring
538 which units are running or are stopped, they do not
539 save/restore any other state. Snapshots are dynamic and lost
540 on reboot.</p></dd><dt id="delete PATTERN..."><span class="term"><span class="command"><strong>delete <em class="replaceable"><code>PATTERN</code></em>...</strong></span></span><a class="headerlink" title="Permalink to this term" href="#delete%20PATTERN..."></a></dt><dd><p>Remove a snapshot previously created with
541 <span class="command"><strong>snapshot</strong></span>.</p></dd></dl></div></div><div class="refsect2"><a name="idm140128979281440"></a><h3 id="Environment Commands">Environment Commands<a class="headerlink" title="Permalink to this headline" href="#Environment%20Commands"></a></h3><div class="variablelist"><dl class="variablelist"><dt id="show-environment"><span class="term"><span class="command"><strong>show-environment</strong></span></span><a class="headerlink" title="Permalink to this term" href="#show-environment"></a></dt><dd><p>Dump the systemd manager environment block. The
542 environment block will be dumped in straight-forward form
543 suitable for sourcing into a shell script. This environment
544 block will be passed to all processes the manager
545 spawns.</p></dd><dt id="set-environment VARIABLE=VALUE..."><span class="term"><span class="command"><strong>set-environment <em class="replaceable"><code>VARIABLE=VALUE</code></em>...</strong></span></span><a class="headerlink" title="Permalink to this term" href="#set-environment%20VARIABLE=VALUE..."></a></dt><dd><p>Set one or more systemd manager environment variables,
546 as specified on the command line.</p></dd><dt id="unset-environment VARIABLE..."><span class="term"><span class="command"><strong>unset-environment <em class="replaceable"><code>VARIABLE</code></em>...</strong></span></span><a class="headerlink" title="Permalink to this term" href="#unset-environment%20VARIABLE..."></a></dt><dd><p>Unset one or more systemd manager environment
547 variables. If only a variable name is specified, it will be
548 removed regardless of its value. If a variable and a value
549 are specified, the variable is only removed if it has the
550 specified value.</p></dd><dt id="import-environment VARIABLE..."><span class="term"><span class="command"><strong>import-environment <em class="replaceable"><code>VARIABLE</code></em>...</strong></span></span><a class="headerlink" title="Permalink to this term" href="#import-environment%20VARIABLE..."></a></dt><dd><p>Import all, one or more environment variables set on
551 the client into the systemd manager environment block. If
552 no arguments are passed, the entire environment block is
553 imported. Otherwise, a list of one or more environment
554 variable names should be passed, whose client-side values
555 are then imported into the manager's environment
556 block.</p></dd></dl></div></div><div class="refsect2"><a name="idm140128979270384"></a><h3 id="Manager Lifecycle Commands">Manager Lifecycle Commands<a class="headerlink" title="Permalink to this headline" href="#Manager%20Lifecycle%20Commands"></a></h3><div class="variablelist"><dl class="variablelist"><dt id="daemon-reload"><span class="term"><span class="command"><strong>daemon-reload</strong></span></span><a class="headerlink" title="Permalink to this term" href="#daemon-reload"></a></dt><dd><p>Reload systemd manager configuration. This will reload
557 all unit files and recreate the entire dependency
558 tree. While the daemon is being reloaded, all sockets systemd
559 listens on behalf of user configuration will stay
560 accessible.</p><p>This command should not be confused
561 with the <span class="command"><strong>reload</strong></span> command.</p></dd><dt id="daemon-reexec"><span class="term"><span class="command"><strong>daemon-reexec</strong></span></span><a class="headerlink" title="Permalink to this term" href="#daemon-reexec"></a></dt><dd><p>Reexecute the systemd manager. This will serialize the
562 manager state, reexecute the process and deserialize the
563 state again. This command is of little use except for
564 debugging and package upgrades. Sometimes, it might be
565 helpful as a heavy-weight <span class="command"><strong>daemon-reload</strong></span>.
566 While the daemon is being reexecuted, all sockets systemd listening
567 on behalf of user configuration will stay accessible.
568 </p></dd></dl></div></div><div class="refsect2"><a name="idm140128979262944"></a><h3 id="System Commands">System Commands<a class="headerlink" title="Permalink to this headline" href="#System%20Commands"></a></h3><div class="variablelist"><dl class="variablelist"><dt id="is-system-running"><span class="term"><span class="command"><strong>is-system-running</strong></span></span><a class="headerlink" title="Permalink to this term" href="#is-system-running"></a></dt><dd><p>Checks whether the system is operational. This
569 returns success when the system is fully up and running,
570 meaning not in startup, shutdown or maintenance
571 mode. Failure is returned otherwise. In addition, the
572 current state is printed in a short string to standard
573 output, see table below. Use <code class="option">--quiet</code> to
574 suppress this output.</p><div class="table"><a name="idm140128979259648"></a><p class="title"><b>Table 2. Manager Operational States</b></p><div class="table-contents"><table summary="Manager Operational States" border="1"><colgroup><col class="name"><col class="description"></colgroup><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code class="varname">initializing</code></td><td><p>Early bootup, before
575 <code class="filename">basic.target</code> is reached
576 or the <code class="varname">maintenance</code> state entered.
577 </p></td></tr><tr><td><code class="varname">starting</code></td><td><p>Late bootup, before the job queue
578 becomes idle for the first time, or one of the
579 rescue targets are reached.</p></td></tr><tr><td><code class="varname">running</code></td><td><p>The system is fully
580 operational.</p></td></tr><tr><td><code class="varname">degraded</code></td><td><p>The system is operational but one or more
581 units failed.</p></td></tr><tr><td><code class="varname">maintenance</code></td><td><p>The rescue or emergency target is
582 active.</p></td></tr><tr><td><code class="varname">stopping</code></td><td><p>The manager is shutting
583 down.</p></td></tr></tbody></table></div></div><br class="table-break"></dd><dt id="default"><span class="term"><span class="command"><strong>default</strong></span></span><a class="headerlink" title="Permalink to this term" href="#default"></a></dt><dd><p>Enter default mode. This is mostly equivalent to
584 <span class="command"><strong>isolate default.target</strong></span>.</p></dd><dt id="rescue"><span class="term"><span class="command"><strong>rescue</strong></span></span><a class="headerlink" title="Permalink to this term" href="#rescue"></a></dt><dd><p>Enter rescue mode. This is mostly equivalent to
585 <span class="command"><strong>isolate rescue.target</strong></span>, but also prints a
586 wall message to all users.</p></dd><dt id="emergency"><span class="term"><span class="command"><strong>emergency</strong></span></span><a class="headerlink" title="Permalink to this term" href="#emergency"></a></dt><dd><p>Enter emergency mode. This is mostly equivalent to
587 <span class="command"><strong>isolate emergency.target</strong></span>, but also prints
588 a wall message to all users.</p></dd><dt id="halt"><span class="term"><span class="command"><strong>halt</strong></span></span><a class="headerlink" title="Permalink to this term" href="#halt"></a></dt><dd><p>Shut down and halt the system. This is mostly equivalent to
589 <span class="command"><strong>start halt.target --irreversible</strong></span>, but also
590 prints a wall message to all users. If combined with
591 <code class="option">--force</code>, shutdown of all running services is
592 skipped, however all processes are killed and all file
593 systems are unmounted or mounted read-only, immediately
594 followed by the system halt. If <code class="option">--force</code> is
595 specified twice, the operation is immediately executed
596 without terminating any processes or unmounting any file
597 systems. This may result in data loss.</p></dd><dt id="poweroff"><span class="term"><span class="command"><strong>poweroff</strong></span></span><a class="headerlink" title="Permalink to this term" href="#poweroff"></a></dt><dd><p>Shut down and power-off the system. This is mostly
598 equivalent to <span class="command"><strong>start poweroff.target --irreversible</strong></span>,
599 but also prints a wall message to all users. If combined with
600 <code class="option">--force</code>, shutdown of all running services is
601 skipped, however all processes are killed and all file
602 systems are unmounted or mounted read-only, immediately
603 followed by the powering off. If <code class="option">--force</code> is
604 specified twice, the operation is immediately executed
605 without terminating any processes or unmounting any file
606 systems. This may result in data loss.</p></dd><dt id="reboot arg"><span class="term"><span class="command"><strong>reboot [<span class="optional"><em class="replaceable"><code>arg</code></em></span>]</strong></span></span><a class="headerlink" title="Permalink to this term" href="#reboot%20arg"></a></dt><dd><p>Shut down and reboot the system. This is mostly
607 equivalent to <span class="command"><strong>start reboot.target --irreversible</strong></span>,
608 but also prints a wall message to all users. If combined with
609 <code class="option">--force</code>, shutdown of all running services is
610 skipped, however all processes are killed and all file
611 systems are unmounted or mounted read-only, immediately
612 followed by the reboot. If <code class="option">--force</code> is
613 specified twice, the operation is immediately executed
614 without terminating any processes or unmounting any file
615 systems. This may result in data loss.</p><p>If the optional argument
616 <em class="replaceable"><code>arg</code></em> is given, it will be passed
617 as the optional argument to the
618 <a href="http://man7.org/linux/man-pages/man2/reboot.2.html"><span class="citerefentry"><span class="refentrytitle">reboot</span>(2)</span></a>
619 system call. The value is architecture and firmware
620 specific. As an example, "<code class="literal">recovery</code>" might
621 be used to trigger system recovery, and
622 "<code class="literal">fota</code>" might be used to trigger a
623 <span class="quote"><span class="quote">firmware over the air</span></span> update.</p></dd><dt id="kexec"><span class="term"><span class="command"><strong>kexec</strong></span></span><a class="headerlink" title="Permalink to this term" href="#kexec"></a></dt><dd><p>Shut down and reboot the system via kexec. This is
624 mostly equivalent to <span class="command"><strong>start kexec.target --irreversible</strong></span>,
625 but also prints a wall message to all users. If combined
626 with <code class="option">--force</code>, shutdown of all running
627 services is skipped, however all processes are killed and
628 all file systems are unmounted or mounted read-only,
629 immediately followed by the reboot.</p></dd><dt id="exit"><span class="term"><span class="command"><strong>exit</strong></span></span><a class="headerlink" title="Permalink to this term" href="#exit"></a></dt><dd><p>Ask the systemd manager to quit. This is only
630 supported for user service managers (i.e. in conjunction
631 with the <code class="option">--user</code> option) and will fail
632 otherwise.</p></dd><dt id="suspend"><span class="term"><span class="command"><strong>suspend</strong></span></span><a class="headerlink" title="Permalink to this term" href="#suspend"></a></dt><dd><p>Suspend the system. This will trigger activation of
633 the special <code class="filename">suspend.target</code> target.
634 </p></dd><dt id="hibernate"><span class="term"><span class="command"><strong>hibernate</strong></span></span><a class="headerlink" title="Permalink to this term" href="#hibernate"></a></dt><dd><p>Hibernate the system. This will trigger activation of
635 the special <code class="filename">hibernate.target</code> target.
636 </p></dd><dt id="hybrid-sleep"><span class="term"><span class="command"><strong>hybrid-sleep</strong></span></span><a class="headerlink" title="Permalink to this term" href="#hybrid-sleep"></a></dt><dd><p>Hibernate and suspend the system. This will trigger
637 activation of the special
638 <code class="filename">hybrid-sleep.target</code> target.</p></dd><dt id="switch-root ROOT INIT"><span class="term"><span class="command"><strong>switch-root <em class="replaceable"><code>ROOT</code></em> [<span class="optional"><em class="replaceable"><code>INIT</code></em></span>]</strong></span></span><a class="headerlink" title="Permalink to this term" href="#switch-root%20ROOT%20INIT"></a></dt><dd><p>Switches to a different root directory and executes a
639 new system manager process below it. This is intended for
640 usage in initial RAM disks ("initrd"), and will transition
641 from the initrd's system manager process (a.k.a "init"
642 process) to the main system manager process. This call takes two
643 arguments: the directory that is to become the new root directory, and
644 the path to the new system manager binary below it to
645 execute as PID 1. If the latter is omitted or the empty
646 string, a systemd binary will automatically be searched for
647 and used as init. If the system manager path is omitted or
648 equal to the empty string, the state of the initrd's system
649 manager process is passed to the main system manager, which
650 allows later introspection of the state of the services
651 involved in the initrd boot.</p></dd></dl></div></div><div class="refsect2"><a name="idm140128979203104"></a><h3 id="Parameter Syntax">Parameter Syntax<a class="headerlink" title="Permalink to this headline" href="#Parameter%20Syntax"></a></h3><p>Unit commands listed above take either a single unit name
652 (designated as <em class="replaceable"><code>NAME</code></em>), or multiple
653 unit specifications (designated as
654 <em class="replaceable"><code>PATTERN</code></em>...). In the first case, the
655 unit name with or without a suffix must be given. If the suffix
656 is not specified, systemctl will append a suitable suffix,
657 "<code class="literal">.service</code>" by default, and a type-specific
658 suffix in case of commands which operate only on specific unit
659 types. For example,
660 </p><pre class="programlisting"># systemctl start sshd</pre><p> and
661 </p><pre class="programlisting"># systemctl start sshd.service</pre><p>
662 are equivalent, as are
663 </p><pre class="programlisting"># systemctl isolate default</pre><p>
664 and
665 </p><pre class="programlisting"># systemctl isolate default.target</pre><p>
666 Note that (absolute) paths to device nodes are automatically
667 converted to device unit names, and other (absolute) paths to
668 mount unit names.
669 </p><pre class="programlisting"># systemctl status /dev/sda
670 # systemctl status /home</pre><p>
671 are equivalent to:
672 </p><pre class="programlisting"># systemctl status dev-sda.device
673 # systemctl status home.mount</pre><p>
674 In the second case, shell-style globs will be matched against
675 currently loaded units; literal unit names, with or without
676 a suffix, will be treated as in the first case. This means that
677 literal unit names always refer to exactly one unit, but globs
678 may match zero units and this is not considered an error.</p><p>Glob patterns use
679 <a href="fnmatch.html"><span class="citerefentry"><span class="refentrytitle">fnmatch</span>(3)</span></a>,
680 so normal shell-style globbing rules are used, and
681 "<code class="literal">*</code>", "<code class="literal">?</code>",
682 "<code class="literal">[]</code>" may be used. See
683 <a href="glob.html"><span class="citerefentry"><span class="refentrytitle">glob</span>(7)</span></a>
684 for more details. The patterns are matched against the names of
685 currently loaded units, and patterns which do not match anything
686 are silently skipped. For example:
687 </p><pre class="programlisting"># systemctl stop sshd@*.service</pre><p>
688 will stop all <code class="filename">sshd@.service</code> instances.
689 </p><p>For unit file commands, the specified
690 <em class="replaceable"><code>NAME</code></em> should be the full name of the
691 unit file, or the absolute path to the unit file:
692 </p><pre class="programlisting"># systemctl enable foo.service</pre><p>
693 or
694 </p><pre class="programlisting"># systemctl link /path/to/foo.service</pre><p>
695 </p></div></div><div class="refsect1"><a name="idm140128979188112"></a><h2 id="Exit status">Exit status<a class="headerlink" title="Permalink to this headline" href="#Exit%20status"></a></h2><p>On success, 0 is returned, a non-zero failure
696 code otherwise.</p></div><div class="refsect1"><a name="idm140128979186880"></a><h2 id="Environment">Environment<a class="headerlink" title="Permalink to this headline" href="#Environment"></a></h2><div class="variablelist"><dl class="variablelist"><dt id="$SYSTEMD_EDITOR"><span class="term"><code class="varname">$SYSTEMD_EDITOR</code></span><a class="headerlink" title="Permalink to this term" href="#%24SYSTEMD_EDITOR"></a></dt><dd><p>Editor to use when editing units; overrides
697 <code class="varname">$EDITOR</code> and <code class="varname">$VISUAL</code>. If neither
698 <code class="varname">$SYSTEMD_EDITOR</code> nor <code class="varname">$EDITOR</code> nor
699 <code class="varname">$VISUAL</code> are present or if it is set to an empty
700 string or if their execution failed, systemctl will try to execute well
701 known editors in this order:
702 <a href="nano.html"><span class="citerefentry"><span class="refentrytitle">nano</span>(1)</span></a>,
703 <a href="vim.html"><span class="citerefentry"><span class="refentrytitle">vim</span>(1)</span></a>,
704 <a href="vi.html"><span class="citerefentry"><span class="refentrytitle">vi</span>(1)</span></a>.
705 </p></dd></dl></div><dt id="$SYSTEMD_PAGER"><span class="term"><code class="varname">$SYSTEMD_PAGER</code></span><a class="headerlink" title="Permalink to this term" href="#%24SYSTEMD_PAGER"></a></dt><dd><p>Pager to use when
706 <code class="option">--no-pager</code> is not given;
707 overrides <code class="varname">$PAGER</code>. Setting
708 this to an empty string or the value
709 "<code class="literal">cat</code>" is equivalent to passing
710 <code class="option">--no-pager</code>.</p></dd><dt id="$SYSTEMD_LESS"><span class="term"><code class="varname">$SYSTEMD_LESS</code></span><a class="headerlink" title="Permalink to this term" href="#%24SYSTEMD_LESS"></a></dt><dd><p>Override the default
711 options passed to
712 <span class="command"><strong>less</strong></span>
713 ("<code class="literal">FRSXMK</code>").</p></dd></div><div class="refsect1"><a name="idm140128979178208"></a><h2 id="See Also">See Also<a class="headerlink" title="Permalink to this headline" href="#See%20Also"></a></h2><p>
714 <a href="systemd.html"><span class="citerefentry"><span class="refentrytitle">systemd</span>(1)</span></a>,
715 <a href="systemadm.html"><span class="citerefentry"><span class="refentrytitle">systemadm</span>(1)</span></a>,
716 <a href="journalctl.html"><span class="citerefentry"><span class="refentrytitle">journalctl</span>(1)</span></a>,
717 <a href="loginctl.html"><span class="citerefentry"><span class="refentrytitle">loginctl</span>(1)</span></a>,
718 <a href="systemd.unit.html"><span class="citerefentry"><span class="refentrytitle">systemd.unit</span>(5)</span></a>,
719 <a href="systemd.resource-management.html"><span class="citerefentry"><span class="refentrytitle">systemd.resource-management</span>(5)</span></a>,
720 <a href="systemd.special.html"><span class="citerefentry"><span class="refentrytitle">systemd.special</span>(7)</span></a>,
721 <a href="http://man7.org/linux/man-pages/man1/wall.1.html"><span class="citerefentry"><span class="refentrytitle">wall</span>(1)</span></a>,
722 <a href="systemd.preset.html"><span class="citerefentry"><span class="refentrytitle">systemd.preset</span>(5)</span></a>,
723 <a href="glob.html"><span class="citerefentry"><span class="refentrytitle">glob</span>(7)</span></a>
724 </p></div></div></body></html>