]>
Commit | Line | Data |
---|---|---|
3802a3d3 | 1 | <?xml version='1.0'?> <!--*- Mode: nxml; nxml-child-indent: 2; indent-tabs-mode: nil -*--> |
7874bcd6 | 2 | <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" |
681eb9cf FB |
3 | "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [ |
4 | <!ENTITY % entities SYSTEM "custom-entities.ent" > | |
5 | %entities; | |
6 | ]> | |
7874bcd6 LP |
7 | |
8 | <!-- | |
b975b0d5 | 9 | This file is part of systemd. |
7874bcd6 | 10 | |
b975b0d5 | 11 | Copyright 2010 Lennart Poettering |
7874bcd6 | 12 | |
b975b0d5 ZJS |
13 | systemd is free software; you can redistribute it and/or modify it |
14 | under the terms of the GNU Lesser General Public License as published by | |
15 | the Free Software Foundation; either version 2.1 of the License, or | |
16 | (at your option) any later version. | |
7874bcd6 | 17 | |
b975b0d5 ZJS |
18 | systemd is distributed in the hope that it will be useful, but |
19 | WITHOUT ANY WARRANTY; without even the implied warranty of | |
20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
21 | Lesser General Public License for more details. | |
7874bcd6 | 22 | |
b975b0d5 ZJS |
23 | You should have received a copy of the GNU Lesser General Public License |
24 | along with systemd; If not, see <http://www.gnu.org/licenses/>. | |
7874bcd6 LP |
25 | --> |
26 | ||
21ac6ff1 ZJS |
27 | <refentry id="systemctl" |
28 | xmlns:xi="http://www.w3.org/2001/XInclude"> | |
7874bcd6 | 29 | |
4a6022f0 ZJS |
30 | <refentryinfo> |
31 | <title>systemctl</title> | |
32 | <productname>systemd</productname> | |
33 | ||
34 | <authorgroup> | |
35 | <author> | |
36 | <contrib>Developer</contrib> | |
37 | <firstname>Lennart</firstname> | |
38 | <surname>Poettering</surname> | |
39 | <email>lennart@poettering.net</email> | |
40 | </author> | |
41 | </authorgroup> | |
42 | </refentryinfo> | |
43 | ||
44 | <refmeta> | |
45 | <refentrytitle>systemctl</refentrytitle> | |
46 | <manvolnum>1</manvolnum> | |
47 | </refmeta> | |
48 | ||
49 | <refnamediv> | |
50 | <refname>systemctl</refname> | |
51 | <refpurpose>Control the systemd system and service manager</refpurpose> | |
52 | </refnamediv> | |
53 | ||
54 | <refsynopsisdiv> | |
55 | <cmdsynopsis> | |
56 | <command>systemctl</command> | |
57 | <arg choice="opt" rep="repeat">OPTIONS</arg> | |
58 | <arg choice="plain">COMMAND</arg> | |
59 | <arg choice="opt" rep="repeat">NAME</arg> | |
60 | </cmdsynopsis> | |
61 | </refsynopsisdiv> | |
62 | ||
63 | <refsect1> | |
64 | <title>Description</title> | |
65 | ||
a4390b6b LP |
66 | <para><command>systemctl</command> may be used to introspect and |
67 | control the state of the <literal>systemd</literal> system and | |
68 | service manager. Please refer to | |
4a6022f0 | 69 | <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry> |
a4390b6b LP |
70 | for an introduction into the basic concepts and functionality this |
71 | tool manages.</para> | |
4a6022f0 ZJS |
72 | </refsect1> |
73 | ||
74 | <refsect1> | |
75 | <title>Options</title> | |
76 | ||
77 | <para>The following options are understood:</para> | |
78 | ||
79 | <variablelist> | |
4a6022f0 ZJS |
80 | <varlistentry> |
81 | <term><option>-t</option></term> | |
82 | <term><option>--type=</option></term> | |
83 | ||
84 | <listitem> | |
e9dd9f95 | 85 | <para>The argument should be a comma-separated list of unit |
20b3f379 | 86 | types such as <option>service</option> and |
9b9b3d36 MW |
87 | <option>socket</option>. |
88 | </para> | |
20b3f379 ZJS |
89 | |
90 | <para>If one of the arguments is a unit type, when listing | |
7b870f60 | 91 | units, limit display to certain unit types. Otherwise, units |
4a6022f0 ZJS |
92 | of all types will be shown.</para> |
93 | ||
20b3f379 | 94 | <para>As a special case, if one of the arguments is |
4a6022f0 ZJS |
95 | <option>help</option>, a list of allowed values will be |
96 | printed and the program will exit.</para> | |
97 | </listitem> | |
98 | </varlistentry> | |
99 | ||
9b9b3d36 MW |
100 | <varlistentry> |
101 | <term><option>--state=</option></term> | |
102 | ||
103 | <listitem> | |
e16972e6 ZJS |
104 | <para>The argument should be a comma-separated list of unit |
105 | LOAD, SUB, or ACTIVE states. When listing units, show only | |
a8eaaee7 | 106 | those in the specified states. Use <option>--state=failed</option> |
e16972e6 ZJS |
107 | to show only failed units.</para> |
108 | ||
109 | <para>As a special case, if one of the arguments is | |
110 | <option>help</option>, a list of allowed values will be | |
111 | printed and the program will exit.</para> | |
9b9b3d36 MW |
112 | </listitem> |
113 | </varlistentry> | |
114 | ||
4a6022f0 ZJS |
115 | <varlistentry> |
116 | <term><option>-p</option></term> | |
117 | <term><option>--property=</option></term> | |
118 | ||
119 | <listitem> | |
54c31a79 | 120 | <para>When showing unit/job/manager properties with the |
ea539eb6 ZJS |
121 | <command>show</command> command, limit display to properties |
122 | specified in the argument. The argument should be a | |
d2bbca68 | 123 | comma-separated list of property names, such as |
ea539eb6 ZJS |
124 | <literal>MainPID</literal>. Unless specified, all known |
125 | properties are shown. If specified more than once, all | |
126 | properties with the specified names are shown. Shell | |
127 | completion is implemented for property names.</para> | |
128 | ||
129 | <para>For the manager itself, | |
130 | <command>systemctl show</command> will show all available | |
131 | properties. Those properties are documented in | |
132 | <citerefentry><refentrytitle>systemd-system.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>. | |
133 | </para> | |
134 | ||
135 | <para>Properties for units vary by unit type, so showing any | |
136 | unit (even a non-existent one) is a way to list properties | |
b938cb90 | 137 | pertaining to this type. Similarly, showing any job will list |
ea539eb6 ZJS |
138 | properties pertaining to all jobs. Properties for units are |
139 | documented in | |
140 | <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>, | |
141 | and the pages for individual unit types | |
142 | <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>, | |
143 | <citerefentry><refentrytitle>systemd.socket</refentrytitle><manvolnum>5</manvolnum></citerefentry>, | |
144 | etc.</para> | |
4a6022f0 ZJS |
145 | </listitem> |
146 | </varlistentry> | |
147 | ||
148 | <varlistentry> | |
149 | <term><option>-a</option></term> | |
150 | <term><option>--all</option></term> | |
151 | ||
152 | <listitem> | |
21b587cf ZJS |
153 | <para>When listing units with <command>list-units</command>, also show inactive units and |
154 | units which are following other units. When showing unit/job/manager properties, show all | |
155 | properties regardless whether they are set or not.</para> | |
156 | ||
157 | <para>To list all units installed in the file system, use the | |
a5e4972c | 158 | <command>list-unit-files</command> command instead.</para> |
e9fbae3f ZJS |
159 | |
160 | <para>When listing units with <command>list-dependencies</command>, recursively show | |
161 | dependencies of all dependent units (by default only dependencies of target units are | |
162 | shown).</para> | |
4a6022f0 ZJS |
163 | </listitem> |
164 | </varlistentry> | |
165 | ||
1238ee09 LP |
166 | <varlistentry> |
167 | <term><option>-r</option></term> | |
168 | <term><option>--recursive</option></term> | |
169 | ||
170 | <listitem> | |
171 | <para>When listing units, also show units of local | |
172 | containers. Units of local containers will be prefixed with | |
173 | the container name, separated by a single colon character | |
174 | (<literal>:</literal>).</para> | |
175 | </listitem> | |
176 | </varlistentry> | |
177 | ||
afba4199 ZJS |
178 | <varlistentry> |
179 | <term><option>--reverse</option></term> | |
180 | ||
181 | <listitem> | |
182 | <para>Show reverse dependencies between units with | |
f6375e83 ZJS |
183 | <command>list-dependencies</command>, i.e. follow |
184 | dependencies of type <varname>WantedBy=</varname>, | |
185 | <varname>RequiredBy=</varname>, | |
f6375e83 ZJS |
186 | <varname>PartOf=</varname>, <varname>BoundBy=</varname>, |
187 | instead of <varname>Wants=</varname> and similar. | |
afba4199 ZJS |
188 | </para> |
189 | </listitem> | |
190 | </varlistentry> | |
191 | ||
192 | <varlistentry> | |
193 | <term><option>--after</option></term> | |
9029f642 JSJ |
194 | |
195 | <listitem> | |
196 | <para>With <command>list-dependencies</command>, show the | |
197 | units that are ordered before the specified unit. In other | |
f6375e83 ZJS |
198 | words, recursively list units following the |
199 | <varname>After=</varname> dependency.</para> | |
200 | ||
201 | <para>Note that any <varname>After=</varname> dependency is | |
202 | automatically mirrored to create a | |
203 | <varname>Before=</varname> dependency. Temporal dependencies | |
922d948b | 204 | may be specified explicitly, but are also created implicitly |
f6375e83 ZJS |
205 | for units which are <varname>WantedBy=</varname> targets |
206 | (see | |
207 | <citerefentry><refentrytitle>systemd.target</refentrytitle><manvolnum>5</manvolnum></citerefentry>), | |
208 | and as a result of other directives (for example | |
209 | <varname>RequiresMountsFor=</varname>). Both explicitly | |
210 | and implicitly introduced dependencies are shown with | |
211 | <command>list-dependencies</command>.</para> | |
82948f6c LP |
212 | |
213 | <para>When passed to the <command>list-jobs</command> command, for each printed job show which other jobs are | |
214 | waiting for it. May be combined with <option>--before</option> to show both the jobs waiting for each job as | |
215 | well as all jobs each job is waiting for.</para> | |
9029f642 JSJ |
216 | </listitem> |
217 | </varlistentry> | |
218 | ||
219 | <varlistentry> | |
afba4199 ZJS |
220 | <term><option>--before</option></term> |
221 | ||
222 | <listitem> | |
9029f642 JSJ |
223 | <para>With <command>list-dependencies</command>, show the |
224 | units that are ordered after the specified unit. In other | |
f6375e83 ZJS |
225 | words, recursively list units following the |
226 | <varname>Before=</varname> dependency.</para> | |
82948f6c LP |
227 | |
228 | <para>When passed to the <command>list-jobs</command> command, for each printed job show which other jobs it | |
229 | is waiting for. May be combined with <option>--after</option> to show both the jobs waiting for each job as | |
230 | well as all jobs each job is waiting for.</para> | |
afba4199 ZJS |
231 | </listitem> |
232 | </varlistentry> | |
233 | ||
4a6022f0 | 234 | <varlistentry> |
98a6e132 | 235 | <term><option>-l</option></term> |
4a6022f0 ZJS |
236 | <term><option>--full</option></term> |
237 | ||
238 | <listitem> | |
69d918b0 ZJS |
239 | <para>Do not ellipsize unit names, process tree entries, |
240 | journal output, or truncate unit descriptions in the output | |
241 | of <command>status</command>, <command>list-units</command>, | |
242 | <command>list-jobs</command>, and | |
243 | <command>list-timers</command>.</para> | |
3b3557c4 JS |
244 | <para>Also, show installation targets in the output of |
245 | <command>is-enabled</command>.</para> | |
4a6022f0 ZJS |
246 | </listitem> |
247 | </varlistentry> | |
248 | ||
4f9a9105 ZJS |
249 | <varlistentry> |
250 | <term><option>--value</option></term> | |
251 | ||
252 | <listitem> | |
253 | <para>When printing properties with <command>show</command>, | |
254 | only print the value, and skip the property name and | |
255 | <literal>=</literal>.</para> | |
256 | </listitem> | |
257 | </varlistentry> | |
258 | ||
991f2a39 ZJS |
259 | <varlistentry> |
260 | <term><option>--show-types</option></term> | |
261 | ||
262 | <listitem> | |
263 | <para>When showing sockets, show the type of the socket.</para> | |
264 | </listitem> | |
265 | </varlistentry> | |
266 | ||
23ade460 | 267 | <varlistentry> |
4dc5b821 | 268 | <term><option>--job-mode=</option></term> |
23ade460 MS |
269 | |
270 | <listitem> | |
e0e009c0 JE |
271 | <para>When queuing a new job, this option controls how to deal with |
272 | already queued jobs. It takes one of <literal>fail</literal>, | |
4dc5b821 LP |
273 | <literal>replace</literal>, |
274 | <literal>replace-irreversibly</literal>, | |
275 | <literal>isolate</literal>, | |
276 | <literal>ignore-dependencies</literal>, | |
277 | <literal>ignore-requirements</literal> or | |
278 | <literal>flush</literal>. Defaults to | |
279 | <literal>replace</literal>, except when the | |
280 | <command>isolate</command> command is used which implies the | |
281 | <literal>isolate</literal> job mode.</para> | |
282 | ||
283 | <para>If <literal>fail</literal> is specified and a requested | |
284 | operation conflicts with a pending job (more specifically: | |
285 | causes an already pending start job to be reversed into a stop | |
286 | job or vice versa), cause the operation to fail.</para> | |
287 | ||
288 | <para>If <literal>replace</literal> (the default) is | |
289 | specified, any conflicting pending job will be replaced, as | |
290 | necessary.</para> | |
291 | ||
292 | <para>If <literal>replace-irreversibly</literal> is specified, | |
293 | operate like <literal>replace</literal>, but also mark the new | |
294 | jobs as irreversible. This prevents future conflicting | |
9a92e77e DS |
295 | transactions from replacing these jobs (or even being enqueued |
296 | while the irreversible jobs are still pending). Irreversible | |
297 | jobs can still be cancelled using the <command>cancel</command> | |
d60cb656 AJ |
298 | command. This job mode should be used on any transaction which |
299 | pulls in <filename>shutdown.target</filename>.</para> | |
4dc5b821 LP |
300 | |
301 | <para><literal>isolate</literal> is only valid for start | |
302 | operations and causes all other units to be stopped when the | |
303 | specified unit is started. This mode is always used when the | |
304 | <command>isolate</command> command is used.</para> | |
305 | ||
306 | <para><literal>flush</literal> will cause all queued jobs to | |
307 | be canceled when the new job is enqueued.</para> | |
308 | ||
309 | <para>If <literal>ignore-dependencies</literal> is specified, | |
310 | then all unit dependencies are ignored for this new job and | |
311 | the operation is executed immediately. If passed, no required | |
312 | units of the unit passed will be pulled in, and no ordering | |
313 | dependencies will be honored. This is mostly a debugging and | |
314 | rescue tool for the administrator and should not be used by | |
315 | applications.</para> | |
316 | ||
317 | <para><literal>ignore-requirements</literal> is similar to | |
b040723e | 318 | <literal>ignore-dependencies</literal>, but only causes the |
4dc5b821 | 319 | requirement dependencies to be ignored, the ordering |
2dd67817 | 320 | dependencies will still be honored.</para> |
23ade460 | 321 | </listitem> |
4a6022f0 | 322 | |
4a6022f0 ZJS |
323 | </varlistentry> |
324 | ||
ac5e3a50 JS |
325 | <varlistentry> |
326 | <term><option>--fail</option></term> | |
327 | ||
328 | <listitem> | |
329 | <para>Shorthand for <option>--job-mode=</option>fail.</para> | |
330 | <para>When used with the <command>kill</command> command, | |
331 | if no units were killed, the operation results in an error. | |
332 | </para> | |
333 | </listitem> | |
334 | </varlistentry> | |
335 | ||
4a6022f0 ZJS |
336 | <varlistentry> |
337 | <term><option>-i</option></term> | |
338 | <term><option>--ignore-inhibitors</option></term> | |
339 | ||
340 | <listitem> | |
341 | <para>When system shutdown or a sleep state is requested, | |
342 | ignore inhibitor locks. Applications can establish inhibitor | |
343 | locks to avoid that certain important operations (such as CD | |
344 | burning or suchlike) are interrupted by system shutdown or a | |
345 | sleep state. Any user may take these locks and privileged | |
346 | users may override these locks. If any locks are taken, | |
347 | shutdown and sleep state requests will normally fail | |
494a6682 | 348 | (regardless of whether privileged or not) and a list of active locks |
7b870f60 JE |
349 | is printed. However, if <option>--ignore-inhibitors</option> |
350 | is specified, the locks are ignored and not printed, and the | |
4a6022f0 ZJS |
351 | operation attempted anyway, possibly requiring additional |
352 | privileges.</para> | |
353 | </listitem> | |
354 | </varlistentry> | |
355 | ||
356 | <varlistentry> | |
357 | <term><option>-q</option></term> | |
358 | <term><option>--quiet</option></term> | |
359 | ||
360 | <listitem> | |
bbd46aad ZJS |
361 | <para>Suppress printing of the results of various commands |
362 | and also the hints about truncated log lines. This does not | |
363 | suppress output of commands for which the printed output is | |
364 | the only result (like <command>show</command>). Errors are | |
365 | always printed.</para> | |
4a6022f0 ZJS |
366 | </listitem> |
367 | </varlistentry> | |
368 | ||
369 | <varlistentry> | |
370 | <term><option>--no-block</option></term> | |
371 | ||
372 | <listitem> | |
373 | <para>Do not synchronously wait for the requested operation | |
7b870f60 | 374 | to finish. If this is not specified, the job will be |
4a6022f0 | 375 | verified, enqueued and <command>systemctl</command> will |
3d161f99 | 376 | wait until the unit's start-up is completed. By passing this |
93a08841 MP |
377 | argument, it is only verified and enqueued. This option may not be |
378 | combined with <option>--wait</option>.</para> | |
379 | </listitem> | |
380 | </varlistentry> | |
381 | ||
382 | <varlistentry> | |
383 | <term><option>--wait</option></term> | |
384 | ||
385 | <listitem> | |
386 | <para>Synchronously wait for started units to terminate again. | |
387 | This option may not be combined with <option>--no-block</option>. | |
388 | Note that this will wait forever if any given unit never terminates | |
389 | (by itself or by getting stopped explicitly); particularly services | |
390 | which use <literal>RemainAfterExit=yes</literal>.</para> | |
4a6022f0 ZJS |
391 | </listitem> |
392 | </varlistentry> | |
393 | ||
88ae7333 ZJS |
394 | <xi:include href="user-system-options.xml" xpointer="user" /> |
395 | <xi:include href="user-system-options.xml" xpointer="system" /> | |
4a6022f0 | 396 | |
bef19548 ZJS |
397 | <varlistentry> |
398 | <term><option>--failed</option></term> | |
399 | ||
400 | <listitem> | |
401 | <para>List units in failed state. This is equivalent to | |
402 | <option>--state=failed</option>.</para> | |
403 | </listitem> | |
404 | </varlistentry> | |
599b6322 | 405 | |
4a6022f0 ZJS |
406 | <varlistentry> |
407 | <term><option>--no-wall</option></term> | |
408 | ||
409 | <listitem> | |
7b870f60 | 410 | <para>Do not send wall message before halt, power-off, |
4a6022f0 ZJS |
411 | reboot.</para> |
412 | </listitem> | |
413 | </varlistentry> | |
414 | ||
415 | <varlistentry> | |
416 | <term><option>--global</option></term> | |
417 | ||
418 | <listitem> | |
419 | <para>When used with <command>enable</command> and | |
420 | <command>disable</command>, operate on the global user | |
421 | configuration directory, thus enabling or disabling a unit | |
422 | file globally for all future logins of all users.</para> | |
423 | </listitem> | |
424 | </varlistentry> | |
425 | ||
426 | <varlistentry> | |
427 | <term><option>--no-reload</option></term> | |
428 | ||
429 | <listitem> | |
430 | <para>When used with <command>enable</command> and | |
431 | <command>disable</command>, do not implicitly reload daemon | |
432 | configuration after executing the changes.</para> | |
433 | </listitem> | |
434 | </varlistentry> | |
435 | ||
436 | <varlistentry> | |
437 | <term><option>--no-ask-password</option></term> | |
438 | ||
439 | <listitem> | |
440 | <para>When used with <command>start</command> and related | |
441 | commands, disables asking for passwords. Background services | |
442 | may require input of a password or passphrase string, for | |
443 | example to unlock system hard disks or cryptographic | |
444 | certificates. Unless this option is specified and the | |
7b870f60 | 445 | command is invoked from a terminal, |
4a6022f0 ZJS |
446 | <command>systemctl</command> will query the user on the |
447 | terminal for the necessary secrets. Use this option to | |
7b870f60 | 448 | switch this behavior off. In this case, the password must be |
4a6022f0 ZJS |
449 | supplied by some other means (for example graphical password |
450 | agents) or the service might fail. This also disables | |
451 | querying the user for authentication for privileged | |
452 | operations.</para> | |
453 | </listitem> | |
4a6022f0 ZJS |
454 | </varlistentry> |
455 | ||
456 | <varlistentry> | |
457 | <term><option>--kill-who=</option></term> | |
458 | ||
459 | <listitem> | |
460 | <para>When used with <command>kill</command>, choose which | |
af7424af LP |
461 | processes to send a signal to. Must be one of |
462 | <option>main</option>, <option>control</option> or | |
463 | <option>all</option> to select whether to kill only the main | |
464 | process, the control process or all processes of the | |
465 | unit. The main process of the unit is the one that defines | |
466 | the life-time of it. A control process of a unit is one that | |
467 | is invoked by the manager to induce state changes of it. For | |
468 | example, all processes started due to the | |
469 | <varname>ExecStartPre=</varname>, | |
470 | <varname>ExecStop=</varname> or | |
471 | <varname>ExecReload=</varname> settings of service units are | |
472 | control processes. Note that there is only one control | |
473 | process per unit at a time, as only one state change is | |
474 | executed at a time. For services of type | |
b8bde116 | 475 | <varname>Type=forking</varname>, the initial process started |
af7424af LP |
476 | by the manager for <varname>ExecStart=</varname> is a |
477 | control process, while the process ultimately forked off by | |
478 | that one is then considered the main process of the unit (if | |
479 | it can be determined). This is different for service units | |
480 | of other types, where the process forked off by the manager | |
481 | for <varname>ExecStart=</varname> is always the main process | |
b8bde116 JE |
482 | itself. A service unit consists of zero or one main process, |
483 | zero or one control process plus any number of additional | |
af7424af | 484 | processes. Not all unit types manage processes of these |
b8bde116 | 485 | types however. For example, for mount units, control processes |
af7424af | 486 | are defined (which are the invocations of |
d31dd62b FB |
487 | <filename>&MOUNT_PATH;</filename> and |
488 | <filename>&UMOUNT_PATH;</filename>), but no main process | |
af7424af LP |
489 | is defined. If omitted, defaults to |
490 | <option>all</option>.</para> | |
4a6022f0 ZJS |
491 | </listitem> |
492 | ||
493 | </varlistentry> | |
494 | ||
495 | <varlistentry> | |
496 | <term><option>-s</option></term> | |
497 | <term><option>--signal=</option></term> | |
498 | ||
499 | <listitem> | |
500 | <para>When used with <command>kill</command>, choose which | |
501 | signal to send to selected processes. Must be one of the | |
b938cb90 | 502 | well-known signal specifiers such as <constant>SIGTERM</constant>, <constant>SIGINT</constant> or |
7b870f60 | 503 | <constant>SIGSTOP</constant>. If omitted, defaults to |
4a6022f0 ZJS |
504 | <option>SIGTERM</option>.</para> |
505 | </listitem> | |
506 | </varlistentry> | |
507 | ||
508 | <varlistentry> | |
509 | <term><option>-f</option></term> | |
510 | <term><option>--force</option></term> | |
511 | ||
512 | <listitem> | |
513 | <para>When used with <command>enable</command>, overwrite | |
514 | any existing conflicting symlinks.</para> | |
515 | ||
39c38ce1 DC |
516 | <para>When used with <command>edit</command>, create all of the |
517 | specified units which do not already exist.</para> | |
518 | ||
924e44b4 LP |
519 | <para>When used with <command>halt</command>, <command>poweroff</command>, <command>reboot</command> or |
520 | <command>kexec</command>, execute the selected operation without shutting down all units. However, all | |
521 | processes will be killed forcibly and all file systems are unmounted or remounted read-only. This is hence a | |
522 | drastic but relatively safe option to request an immediate reboot. If <option>--force</option> is specified | |
523 | twice for these operations (with the exception of <command>kexec</command>), they will be executed | |
524 | immediately, without terminating any processes or unmounting any file systems. Warning: specifying | |
525 | <option>--force</option> twice with any of these operations might result in data loss. Note that when | |
526 | <option>--force</option> is specified twice the selected operation is executed by | |
527 | <command>systemctl</command> itself, and the system manager is not contacted. This means the command should | |
528 | succeed even when the system manager hangs or crashed.</para> | |
4a6022f0 ZJS |
529 | </listitem> |
530 | </varlistentry> | |
531 | ||
9ef15026 JS |
532 | <varlistentry> |
533 | <term><option>--message=</option></term> | |
534 | ||
535 | <listitem> | |
536 | <para>When used with <command>halt</command>, | |
537 | <command>poweroff</command>, <command>reboot</command> or | |
538 | <command>kexec</command>, set a short message explaining the reason | |
539 | for the operation. The message will be logged together with the | |
540 | default shutdown message.</para> | |
541 | </listitem> | |
542 | </varlistentry> | |
543 | ||
57ab2eab JS |
544 | <varlistentry> |
545 | <term><option>--now</option></term> | |
546 | ||
547 | <listitem> | |
548 | <para>When used with <command>enable</command>, the units | |
549 | will also be started. When used with <command>disable</command> or | |
550 | <command>mask</command>, the units will also be stopped. The start | |
551 | or stop operation is only carried out when the respective enable or | |
552 | disable operation has been successful.</para> | |
553 | </listitem> | |
554 | </varlistentry> | |
555 | ||
4a6022f0 ZJS |
556 | <varlistentry> |
557 | <term><option>--root=</option></term> | |
558 | ||
559 | <listitem> | |
560 | <para>When used with | |
561 | <command>enable</command>/<command>disable</command>/<command>is-enabled</command> | |
9b914a9d ZJS |
562 | (and related commands), use the specified root path when looking for unit |
563 | files. If this option is present, <command>systemctl</command> will operate on | |
564 | the file system directly, instead of communicating with the <command>systemd</command> | |
565 | daemon to carry out changes.</para> | |
4a6022f0 ZJS |
566 | </listitem> |
567 | ||
568 | </varlistentry> | |
569 | ||
570 | <varlistentry> | |
571 | <term><option>--runtime</option></term> | |
572 | ||
573 | <listitem> | |
a330b376 | 574 | <para>When used with <command>enable</command>, |
7d4fb3b1 | 575 | <command>disable</command>, <command>edit</command>, |
4a6022f0 | 576 | (and related commands), make changes only temporarily, so |
a330b376 | 577 | that they are lost on the next reboot. This will have the |
4a6022f0 ZJS |
578 | effect that changes are not made in subdirectories of |
579 | <filename>/etc</filename> but in <filename>/run</filename>, | |
580 | with identical immediate effects, however, since the latter | |
581 | is lost on reboot, the changes are lost too.</para> | |
a330b376 | 582 | |
494a6682 | 583 | <para>Similarly, when used with |
fbce1139 | 584 | <command>set-property</command>, make changes only |
a330b376 LP |
585 | temporarily, so that they are lost on the next |
586 | reboot.</para> | |
4a6022f0 ZJS |
587 | </listitem> |
588 | </varlistentry> | |
589 | ||
d309c1c3 LP |
590 | <varlistentry> |
591 | <term><option>--preset-mode=</option></term> | |
592 | ||
593 | <listitem> | |
594 | <para>Takes one of <literal>full</literal> (the default), | |
595 | <literal>enable-only</literal>, | |
8d0e0ddd | 596 | <literal>disable-only</literal>. When used with the |
d309c1c3 | 597 | <command>preset</command> or <command>preset-all</command> |
8d0e0ddd | 598 | commands, controls whether units shall be disabled and |
d309c1c3 LP |
599 | enabled according to the preset rules, or only enabled, or |
600 | only disabled.</para> | |
601 | </listitem> | |
602 | </varlistentry> | |
603 | ||
4a6022f0 ZJS |
604 | <varlistentry> |
605 | <term><option>-n</option></term> | |
606 | <term><option>--lines=</option></term> | |
607 | ||
608 | <listitem> | |
7b870f60 | 609 | <para>When used with <command>status</command>, controls the |
4a6022f0 ZJS |
610 | number of journal lines to show, counting from the most |
611 | recent ones. Takes a positive integer argument. Defaults to | |
612 | 10.</para> | |
613 | </listitem> | |
614 | </varlistentry> | |
615 | ||
616 | <varlistentry> | |
617 | <term><option>-o</option></term> | |
618 | <term><option>--output=</option></term> | |
619 | ||
620 | <listitem> | |
7b870f60 | 621 | <para>When used with <command>status</command>, controls the |
4a6022f0 | 622 | formatting of the journal entries that are shown. For the |
7b870f60 | 623 | available choices, see |
4a6022f0 ZJS |
624 | <citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>. |
625 | Defaults to <literal>short</literal>.</para> | |
626 | </listitem> | |
627 | </varlistentry> | |
628 | ||
5bdf2243 JJ |
629 | <varlistentry> |
630 | <term><option>--firmware-setup</option></term> | |
631 | ||
632 | <listitem> | |
633 | <para>When used with the <command>reboot</command> command, | |
634 | indicate to the system's firmware to boot into setup | |
635 | mode. Note that this is currently only supported on some EFI | |
636 | systems and only if the system was booted in EFI | |
637 | mode.</para> | |
638 | </listitem> | |
639 | </varlistentry> | |
640 | ||
5d0c05e5 LN |
641 | <varlistentry> |
642 | <term><option>--plain</option></term> | |
643 | ||
644 | <listitem> | |
7b870f60 | 645 | <para>When used with <command>list-dependencies</command>, |
831d3dc8 | 646 | <command>list-units</command> or <command>list-machines</command>, |
a20e43c0 MT |
647 | the output is printed as a list instead of a tree, and the bullet |
648 | circles are omitted.</para> | |
5d0c05e5 LN |
649 | </listitem> |
650 | </varlistentry> | |
651 | ||
4f50d2ef ZJS |
652 | <xi:include href="user-system-options.xml" xpointer="host" /> |
653 | <xi:include href="user-system-options.xml" xpointer="machine" /> | |
654 | ||
12f15e59 ZJS |
655 | <xi:include href="standard-options.xml" xpointer="no-pager" /> |
656 | <xi:include href="standard-options.xml" xpointer="no-legend" /> | |
dfdebb1b ZJS |
657 | <xi:include href="standard-options.xml" xpointer="help" /> |
658 | <xi:include href="standard-options.xml" xpointer="version" /> | |
4a6022f0 ZJS |
659 | </variablelist> |
660 | </refsect1> | |
661 | ||
662 | <refsect1> | |
663 | <title>Commands</title> | |
664 | ||
665 | <para>The following commands are understood:</para> | |
666 | ||
27722f96 LN |
667 | <refsect2> |
668 | <title>Unit Commands</title> | |
4a6022f0 | 669 | |
27722f96 LN |
670 | <variablelist> |
671 | <varlistentry> | |
1eecafb8 | 672 | <term><command>list-units <optional><replaceable>PATTERN</replaceable>…</optional></command></term> |
4a6022f0 | 673 | |
27722f96 | 674 | <listitem> |
2cdbbc9a LP |
675 | <para>List units that <command>systemd</command> currently has in memory. This includes units that are |
676 | either referenced directly or through a dependency, units that are pinned by applications programmatically, | |
677 | or units that were active in the past and have failed. By default only units which are active, have pending | |
678 | jobs, or have failed are shown; this can be changed with option <option>--all</option>. If one or more | |
05a98afd LP |
679 | <replaceable>PATTERN</replaceable>s are specified, only units matching one of them are shown. The units |
680 | that are shown are additionally filtered by <option>--type=</option> and <option>--state=</option> if those | |
681 | options are specified.</para> | |
991f2a39 | 682 | |
27722f96 LN |
683 | <para>This is the default command.</para> |
684 | </listitem> | |
685 | </varlistentry> | |
991f2a39 | 686 | |
27722f96 | 687 | <varlistentry> |
1eecafb8 | 688 | <term><command>list-sockets <optional><replaceable>PATTERN</replaceable>…</optional></command></term> |
27722f96 LN |
689 | |
690 | <listitem> | |
2cdbbc9a LP |
691 | <para>List socket units currently in memory, ordered by listening address. If one or more |
692 | <replaceable>PATTERN</replaceable>s are specified, only socket units matching one of them are | |
d8fba7c6 | 693 | shown. Produces output similar to |
27722f96 | 694 | <programlisting> |
991f2a39 ZJS |
695 | LISTEN UNIT ACTIVATES |
696 | /dev/initctl systemd-initctl.socket systemd-initctl.service | |
1eecafb8 | 697 | … |
991f2a39 ZJS |
698 | [::]:22 sshd.socket sshd.service |
699 | kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service | |
700 | ||
9fccdb0f | 701 | 5 sockets listed.</programlisting> |
27722f96 LN |
702 | Note: because the addresses might contains spaces, this output |
703 | is not suitable for programmatic consumption. | |
704 | </para> | |
705 | ||
2cdbbc9a | 706 | <para>Also see <option>--show-types</option>, <option>--all</option>, and <option>--state=</option>.</para> |
27722f96 LN |
707 | </listitem> |
708 | </varlistentry> | |
709 | ||
cbb76c29 | 710 | <varlistentry> |
1eecafb8 | 711 | <term><command>list-timers <optional><replaceable>PATTERN</replaceable>…</optional></command></term> |
cbb76c29 LP |
712 | |
713 | <listitem> | |
2cdbbc9a LP |
714 | <para>List timer units currently in memory, ordered by the time they elapse next. If one or more |
715 | <replaceable>PATTERN</replaceable>s are specified, only units matching one of them are shown. | |
3c3fff44 | 716 | Produces output similar to |
ccdda955 MS |
717 | <programlisting> |
718 | NEXT LEFT LAST PASSED UNIT ACTIVATES | |
719 | n/a n/a Thu 2017-02-23 13:40:29 EST 3 days ago ureadahead-stop.timer ureadahead-stop.service | |
720 | Sun 2017-02-26 18:55:42 EST 1min 14s left Thu 2017-02-23 13:54:44 EST 3 days ago systemd-tmpfiles-clean.timer systemd-tmpfiles-clean.service | |
721 | Sun 2017-02-26 20:37:16 EST 1h 42min left Sun 2017-02-26 11:56:36 EST 6h ago apt-daily.timer apt-daily.service | |
722 | Sun 2017-02-26 20:57:49 EST 2h 3min left Sun 2017-02-26 11:56:36 EST 6h ago snapd.refresh.timer snapd.refresh.service | |
723 | </programlisting> | |
d8fba7c6 | 724 | </para> |
cbb76c29 | 725 | |
ccdda955 MS |
726 | <para><emphasis>NEXT</emphasis> shows the next time the timer will run.</para> |
727 | <para><emphasis>LEFT</emphasis> shows how long till the next time the timer runs.</para> | |
728 | <para><emphasis>LAST</emphasis> shows the last time the timer ran.</para> | |
729 | <para><emphasis>PASSED</emphasis> shows has long as passed since the timer laset ran.</para> | |
730 | <para><emphasis>UNIT</emphasis> shows the name of the timer</para> | |
785889e5 | 731 | <para><emphasis>ACTIVATES</emphasis> shows the name the service the timer activates when it runs.</para> |
ccdda955 | 732 | |
2cdbbc9a | 733 | <para>Also see <option>--all</option> and <option>--state=</option>.</para> |
cbb76c29 LP |
734 | </listitem> |
735 | </varlistentry> | |
736 | ||
27722f96 | 737 | <varlistentry> |
1eecafb8 | 738 | <term><command>start <replaceable>PATTERN</replaceable>…</command></term> |
27722f96 LN |
739 | |
740 | <listitem> | |
741 | <para>Start (activate) one or more units specified on the | |
742 | command line.</para> | |
e3e0314b | 743 | |
2cdbbc9a LP |
744 | <para>Note that glob patterns operate on the set of primary names of units currently in memory. Units which |
745 | are not active and are not in a failed state usually are not in memory, and will not be matched by any | |
1f00eded LP |
746 | pattern. In addition, in case of instantiated units, systemd is often unaware of the instance name until |
747 | the instance has been started. Therefore, using glob patterns with <command>start</command> has limited | |
748 | usefulness. Also, secondary alias names of units are not considered.</para> | |
27722f96 LN |
749 | </listitem> |
750 | </varlistentry> | |
751 | <varlistentry> | |
1eecafb8 | 752 | <term><command>stop <replaceable>PATTERN</replaceable>…</command></term> |
27722f96 LN |
753 | |
754 | <listitem> | |
755 | <para>Stop (deactivate) one or more units specified on the | |
756 | command line.</para> | |
757 | </listitem> | |
758 | </varlistentry> | |
759 | <varlistentry> | |
1eecafb8 | 760 | <term><command>reload <replaceable>PATTERN</replaceable>…</command></term> |
27722f96 LN |
761 | |
762 | <listitem> | |
763 | <para>Asks all units listed on the command line to reload | |
764 | their configuration. Note that this will reload the | |
765 | service-specific configuration, not the unit configuration | |
766 | file of systemd. If you want systemd to reload the | |
79640424 | 767 | configuration file of a unit, use the |
27722f96 LN |
768 | <command>daemon-reload</command> command. In other words: |
769 | for the example case of Apache, this will reload Apache's | |
770 | <filename>httpd.conf</filename> in the web server, not the | |
771 | <filename>apache.service</filename> systemd unit | |
772 | file.</para> | |
773 | ||
774 | <para>This command should not be confused with the | |
d0a3fb75 | 775 | <command>daemon-reload</command> command.</para> |
27722f96 LN |
776 | </listitem> |
777 | ||
778 | </varlistentry> | |
779 | <varlistentry> | |
1eecafb8 | 780 | <term><command>restart <replaceable>PATTERN</replaceable>…</command></term> |
27722f96 LN |
781 | |
782 | <listitem> | |
6539dd7c | 783 | <para>Stop and then start one or more units specified on the |
784 | command line. If the units are not running yet, they will | |
785 | be started.</para> | |
27722f96 LN |
786 | </listitem> |
787 | </varlistentry> | |
788 | <varlistentry> | |
1eecafb8 | 789 | <term><command>try-restart <replaceable>PATTERN</replaceable>…</command></term> |
27722f96 LN |
790 | |
791 | <listitem> | |
6539dd7c | 792 | <para>Stop and then start one or more units specified on the |
793 | command line if the units are running. This does nothing | |
794 | if units are not running.</para> | |
2fcee0a5 LP |
795 | <!-- Note that we don't document condrestart here, as that is just compatibility support, and we generally |
796 | don't document that. --> | |
27722f96 LN |
797 | </listitem> |
798 | </varlistentry> | |
799 | <varlistentry> | |
1eecafb8 | 800 | <term><command>reload-or-restart <replaceable>PATTERN</replaceable>…</command></term> |
27722f96 LN |
801 | |
802 | <listitem> | |
803 | <para>Reload one or more units if they support it. If not, | |
804 | restart them instead. If the units are not running yet, they | |
805 | will be started.</para> | |
806 | </listitem> | |
807 | </varlistentry> | |
808 | <varlistentry> | |
1eecafb8 | 809 | <term><command>try-reload-or-restart <replaceable>PATTERN</replaceable>…</command></term> |
27722f96 LN |
810 | |
811 | <listitem> | |
812 | <para>Reload one or more units if they support it. If not, | |
813 | restart them instead. This does nothing if the units are not | |
2fcee0a5 LP |
814 | running.</para> |
815 | <!-- Note that we don't document force-reload here, as that is just compatibility support, and we generally | |
816 | don't document that. --> | |
27722f96 LN |
817 | </listitem> |
818 | </varlistentry> | |
819 | <varlistentry> | |
820 | <term><command>isolate <replaceable>NAME</replaceable></command></term> | |
821 | ||
822 | <listitem> | |
26adf774 ZJS |
823 | <para>Start the unit specified on the command line and its dependencies |
824 | and stop all others, unless they have | |
825 | <option>IgnoreOnIsolate=yes</option> (see | |
826 | <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>). | |
827 | If a unit name with no extension is given, an extension of | |
507e28d8 | 828 | <literal>.target</literal> will be assumed.</para> |
27722f96 LN |
829 | |
830 | <para>This is similar to changing the runlevel in a | |
831 | traditional init system. The <command>isolate</command> | |
832 | command will immediately stop processes that are not enabled | |
833 | in the new unit, possibly including the graphical | |
834 | environment or terminal you are currently using.</para> | |
835 | ||
836 | <para>Note that this is allowed only on units where | |
837 | <option>AllowIsolate=</option> is enabled. See | |
838 | <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry> | |
839 | for details.</para> | |
840 | </listitem> | |
841 | </varlistentry> | |
842 | <varlistentry> | |
1eecafb8 | 843 | <term><command>kill <replaceable>PATTERN</replaceable>…</command></term> |
27722f96 LN |
844 | |
845 | <listitem> | |
846 | <para>Send a signal to one or more processes of the | |
847 | unit. Use <option>--kill-who=</option> to select which | |
0088d631 LP |
848 | process to kill. Use <option>--signal=</option> to select |
849 | the signal to send.</para> | |
27722f96 LN |
850 | </listitem> |
851 | </varlistentry> | |
852 | <varlistentry> | |
1eecafb8 | 853 | <term><command>is-active <replaceable>PATTERN</replaceable>…</command></term> |
27722f96 LN |
854 | |
855 | <listitem> | |
856 | <para>Check whether any of the specified units are active | |
6db27428 ZJS |
857 | (i.e. running). Returns an exit code |
858 | <constant>0</constant> if at least one is active, or | |
859 | non-zero otherwise. Unless <option>--quiet</option> is | |
860 | specified, this will also print the current unit state to | |
861 | standard output.</para> | |
27722f96 LN |
862 | </listitem> |
863 | </varlistentry> | |
864 | <varlistentry> | |
1eecafb8 | 865 | <term><command>is-failed <replaceable>PATTERN</replaceable>…</command></term> |
27722f96 LN |
866 | |
867 | <listitem> | |
6db27428 ZJS |
868 | <para>Check whether any of the specified units are in a |
869 | "failed" state. Returns an exit code | |
870 | <constant>0</constant> if at least one has failed, | |
871 | non-zero otherwise. Unless <option>--quiet</option> is | |
872 | specified, this will also print the current unit state to | |
873 | standard output.</para> | |
27722f96 LN |
874 | </listitem> |
875 | </varlistentry> | |
876 | <varlistentry> | |
1eecafb8 | 877 | <term><command>status</command> <optional><replaceable>PATTERN</replaceable>…|<replaceable>PID</replaceable>…]</optional></term> |
27722f96 LN |
878 | |
879 | <listitem> | |
880 | <para>Show terse runtime status information about one or | |
881 | more units, followed by most recent log data from the | |
8fcf784d | 882 | journal. If no units are specified, show system status. If |
b8bde116 | 883 | combined with <option>--all</option>, also show the status of |
8fcf784d LP |
884 | all units (subject to limitations specified with |
885 | <option>-t</option>). If a PID is passed, show information | |
886 | about the unit the process belongs to.</para> | |
27722f96 LN |
887 | |
888 | <para>This function is intended to generate human-readable | |
e213d1a3 | 889 | output. If you are looking for computer-parsable output, |
b938cb90 | 890 | use <command>show</command> instead. By default, this |
e213d1a3 | 891 | function only shows 10 lines of output and ellipsizes |
4559a721 | 892 | lines to fit in the terminal window. This can be changed |
e213d1a3 ZJS |
893 | with <option>--lines</option> and <option>--full</option>, |
894 | see above. In addition, <command>journalctl | |
895 | --unit=<replaceable>NAME</replaceable></command> or | |
896 | <command>journalctl | |
897 | --user-unit=<replaceable>NAME</replaceable></command> use | |
898 | a similar filter for messages and might be more | |
899 | convenient. | |
900 | </para> | |
ab8864eb MS |
901 | |
902 | <para>Systemd implicitly loads units as necessary, so just running the <command>status</command> will | |
903 | attempt to load a file. The command is thus not useful for determining if something was already loaded or | |
904 | not. The units may possibly also be quickly unloaded after the operation is completed if there's no reason | |
905 | to keep it in memory thereafter. | |
906 | </para> | |
907 | ||
908 | <example> | |
909 | <title>Example output from systemctl status </title> | |
910 | ||
911 | <programlisting>$ systemctl status bluetooth | |
912 | ● bluetooth.service - Bluetooth service | |
83ddf5d3 | 913 | Loaded: loaded (/usr/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled) |
ab8864eb MS |
914 | Active: active (running) since Wed 2017-01-04 13:54:04 EST; 1 weeks 0 days ago |
915 | Docs: man:bluetoothd(8) | |
916 | Main PID: 930 (bluetoothd) | |
917 | Status: "Running" | |
918 | Tasks: 1 | |
919 | Memory: 648.0K | |
920 | CPU: 435ms | |
921 | CGroup: /system.slice/bluetooth.service | |
922 | └─930 /usr/lib/bluetooth/bluetoothd | |
923 | ||
924 | Jan 12 10:46:45 example.com bluetoothd[8900]: Not enough free handles to register service | |
542ca7c9 DR |
925 | Jan 12 10:46:45 example.com bluetoothd[8900]: Current Time Service could not be registered |
926 | Jan 12 10:46:45 example.com bluetoothd[8900]: gatt-time-server: Input/output error (5) | |
ab8864eb MS |
927 | </programlisting> |
928 | ||
929 | <para>The dot ("●") uses color on supported terminals to summarize the unit state at a glance. White | |
930 | indicates an <literal>inactive</literal> or <literal>deactivating</literal> state. Red indicates a | |
931 | <literal>failed</literal> or <literal>error</literal> state and green indicates an | |
932 | <literal>active</literal>, <literal>reloading</literal> or <literal>activating</literal> state. | |
933 | </para> | |
934 | ||
935 | <para>The "Loaded:" line in the output will show <literal>loaded</literal> if the unit has been loaded into | |
936 | memory. Other possible values for "Loaded:" include: <literal>error</literal> if there was a problem | |
937 | loading it, <literal>not-found</literal>, and <literal>masked</literal>. Along with showing the path to | |
938 | the unit file, this line will also show the enablement state. Enabled commands start at boot. See the | |
939 | full table of possible enablement states — including the definition of <literal>masked</literal> — in the | |
940 | documentation for the <command>is-enabled</command> command. | |
941 | </para> | |
942 | ||
943 | <para>The "Active:" line shows active state. The value is usually <literal>active</literal> or | |
944 | <literal>inactive</literal>. Active could mean started, bound, plugged in, etc depending on the unit type. | |
945 | The unit could also be in process of changing states, reporting a state of <literal>activating</literal> or | |
946 | <literal>deactivating</literal>. A special <literal>failed</literal> state is entered when the service | |
947 | failed in some way, such as a crash, exiting with an error code or timing out. If the failed state is | |
948 | entered the cause will be logged for later reference.</para> | |
949 | </example> | |
950 | ||
27722f96 LN |
951 | </listitem> |
952 | </varlistentry> | |
953 | <varlistentry> | |
1eecafb8 | 954 | <term><command>show</command> <optional><replaceable>PATTERN</replaceable>…|<replaceable>JOB</replaceable>…</optional></term> |
27722f96 LN |
955 | |
956 | <listitem> | |
33d2308c LP |
957 | <para>Show properties of one or more units, jobs, or the manager itself. If no argument is specified, |
958 | properties of the manager will be shown. If a unit name is specified, properties of the unit are shown, and | |
959 | if a job ID is specified, properties of the job are shown. By default, empty properties are suppressed. Use | |
960 | <option>--all</option> to show those too. To select specific properties to show, use | |
961 | <option>--property=</option>. This command is intended to be used whenever computer-parsable output is | |
962 | required. Use <command>status</command> if you are looking for formatted human-readable output.</para> | |
963 | ||
964 | <para>Many properties shown by <command>systemctl show</command> map directly to configuration settings of | |
965 | the system and service manager and its unit files. Note that the properties shown by the command are | |
966 | generally more low-level, normalized versions of the original configuration settings and expose runtime | |
967 | state in addition to configuration. For example, properties shown for service units include the service's | |
968 | current main process identifier as <literal>MainPID</literal> (which is runtime state), and time settings | |
969 | are always exposed as properties ending in the <literal>…USec</literal> suffix even if a matching | |
970 | configuration options end in <literal>…Sec</literal>, because microseconds is the normalized time unit used | |
971 | by the system and service manager.</para> | |
27722f96 LN |
972 | </listitem> |
973 | </varlistentry> | |
e93c33d4 | 974 | <varlistentry> |
1eecafb8 | 975 | <term><command>cat <replaceable>PATTERN</replaceable>…</command></term> |
27722f96 | 976 | |
e93c33d4 | 977 | <listitem> |
e4c0fbe5 ZJS |
978 | <para>Show backing files of one or more units. Prints the |
979 | "fragment" and "drop-ins" (source files) of units. Each | |
980 | file is preceded by a comment which includes the file | |
d4a48671 LW |
981 | name. Note that this shows the contents of the backing files |
982 | on disk, which may not match the system manager's | |
983 | understanding of these units if any unit files were | |
984 | updated on disk and the <command>daemon-reload</command> | |
985 | command wasn't issued since.</para> | |
e93c33d4 SL |
986 | </listitem> |
987 | </varlistentry> | |
27722f96 | 988 | <varlistentry> |
1eecafb8 | 989 | <term><command>set-property <replaceable>NAME</replaceable> <replaceable>ASSIGNMENT</replaceable>…</command></term> |
27722f96 LN |
990 | |
991 | <listitem> | |
992 | <para>Set the specified unit properties at runtime where | |
993 | this is supported. This allows changing configuration | |
3fde5f30 | 994 | parameter properties such as resource control settings at |
27722f96 | 995 | runtime. Not all properties may be changed at runtime, but |
3fde5f30 LP |
996 | many resource control settings (primarily those in |
997 | <citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>) | |
27722f96 LN |
998 | may. The changes are applied instantly, and stored on disk |
999 | for future boots, unless <option>--runtime</option> is | |
3fde5f30 LP |
1000 | passed, in which case the settings only apply until the |
1001 | next reboot. The syntax of the property assignment follows | |
27722f96 LN |
1002 | closely the syntax of assignments in unit files.</para> |
1003 | ||
1004 | <para>Example: <command>systemctl set-property foobar.service CPUShares=777</command></para> | |
1005 | ||
e9fd88f2 FB |
1006 | <para>If the specified unit appears to be inactive, the |
1007 | changes will be only stored on disk as described | |
1008 | previously hence they will be effective when the unit will | |
1009 | be started.</para> | |
1010 | ||
27722f96 LN |
1011 | <para>Note that this command allows changing multiple |
1012 | properties at the same time, which is preferable over | |
1013 | setting them individually. Like unit file configuration | |
1014 | settings, assigning the empty list to list parameters will | |
1015 | reset the list.</para> | |
1016 | </listitem> | |
1017 | </varlistentry> | |
1018 | ||
1019 | <varlistentry> | |
1eecafb8 | 1020 | <term><command>help <replaceable>PATTERN</replaceable>…|<replaceable>PID</replaceable>…</command></term> |
27722f96 LN |
1021 | |
1022 | <listitem> | |
1023 | <para>Show manual pages for one or more units, if | |
1024 | available. If a PID is given, the manual pages for the unit | |
1025 | the process belongs to are shown.</para> | |
1026 | </listitem> | |
1027 | </varlistentry> | |
1028 | ||
1029 | <varlistentry> | |
1eecafb8 | 1030 | <term><command>reset-failed [<replaceable>PATTERN</replaceable>…]</command></term> |
27722f96 LN |
1031 | |
1032 | <listitem> | |
1033 | <para>Reset the <literal>failed</literal> state of the | |
1034 | specified units, or if no unit name is passed, reset the state of all | |
1035 | units. When a unit fails in some way (i.e. process exiting | |
1036 | with non-zero error code, terminating abnormally or timing | |
1037 | out), it will automatically enter the | |
1038 | <literal>failed</literal> state and its exit code and status | |
1039 | is recorded for introspection by the administrator until the | |
1040 | service is restarted or reset with this command.</para> | |
1041 | </listitem> | |
1042 | </varlistentry> | |
1043 | ||
1044 | <varlistentry> | |
f6375e83 ZJS |
1045 | <term> |
1046 | <command>list-dependencies</command> | |
1047 | <optional><replaceable>NAME</replaceable></optional> | |
1048 | </term> | |
27722f96 LN |
1049 | |
1050 | <listitem> | |
f6375e83 ZJS |
1051 | <para>Shows units required and wanted by the specified |
1052 | unit. This recursively lists units following the | |
1053 | <varname>Requires=</varname>, | |
f6375e83 | 1054 | <varname>Requisite=</varname>, |
fb30c438 | 1055 | <varname>ConsistsOf=</varname>, |
f6375e83 ZJS |
1056 | <varname>Wants=</varname>, <varname>BindsTo=</varname> |
1057 | dependencies. If no unit is specified, | |
1058 | <filename>default.target</filename> is implied.</para> | |
1059 | ||
1060 | <para>By default, only target units are recursively | |
1061 | expanded. When <option>--all</option> is passed, all other | |
1062 | units are recursively expanded as well.</para> | |
1063 | ||
1064 | <para>Options <option>--reverse</option>, | |
1065 | <option>--after</option>, <option>--before</option> | |
1066 | may be used to change what types of dependencies | |
1067 | are shown.</para> | |
27722f96 LN |
1068 | </listitem> |
1069 | </varlistentry> | |
1070 | </variablelist> | |
1071 | </refsect2> | |
1072 | ||
1073 | <refsect2> | |
1074 | <title>Unit File Commands</title> | |
1075 | ||
1076 | <variablelist> | |
1077 | <varlistentry> | |
1eecafb8 | 1078 | <term><command>list-unit-files <optional><replaceable>PATTERN…</replaceable></optional></command></term> |
27722f96 LN |
1079 | |
1080 | <listitem> | |
3990961d LP |
1081 | <para>List unit files installed on the system, in combination with their enablement state (as reported by |
1082 | <command>is-enabled</command>). If one or more <replaceable>PATTERN</replaceable>s are specified, only unit | |
1083 | files whose name matches one of them are shown (patterns matching unit file system paths are not | |
1084 | supported).</para> | |
27722f96 LN |
1085 | </listitem> |
1086 | </varlistentry> | |
1087 | ||
1088 | <varlistentry> | |
1eecafb8 ZJS |
1089 | <term><command>enable <replaceable>NAME</replaceable>…</command></term> |
1090 | <term><command>enable <replaceable>PATH</replaceable>…</command></term> | |
27722f96 LN |
1091 | |
1092 | <listitem> | |
3990961d LP |
1093 | <para>Enable one or more units or unit instances. This will create a set of symlinks, as encoded in the |
1094 | <literal>[Install]</literal> sections of the indicated unit files. After the symlinks have been created, | |
1095 | the system manager configuration is reloaded (in a way equivalent to <command>daemon-reload</command>), in | |
1096 | order to ensure the changes are taken into account immediately. Note that this does | |
1097 | <emphasis>not</emphasis> have the effect of also starting any of the units being enabled. If this is | |
1098 | desired, combine this command with the <option>--now</option> switch, or invoke <command>start</command> | |
1099 | with appropriate arguments later. Note that in case of unit instance enablement (i.e. enablement of units of | |
1100 | the form <filename>foo@bar.service</filename>), symlinks named the same as instances are created in the | |
2dd67817 | 1101 | unit configuration directory, however they point to the single template unit file they are instantiated |
3990961d LP |
1102 | from.</para> |
1103 | ||
93f07c87 ZJS |
1104 | <para>This command expects either valid unit names (in which case various unit file directories are |
1105 | automatically searched for unit files with appropriate names), or absolute paths to unit files (in which | |
1106 | case these files are read directly). If a specified unit file is located outside of the usual unit file | |
1107 | directories, an additional symlink is created, linking it into the unit configuration path, thus ensuring | |
1108 | it is found when requested by commands such as <command>start</command>.</para> | |
3990961d LP |
1109 | |
1110 | <para>This command will print the file system operations executed. This output may be suppressed by passing | |
1111 | <option>--quiet</option>. | |
27722f96 LN |
1112 | </para> |
1113 | ||
3990961d LP |
1114 | <para>Note that this operation creates only the symlinks suggested in the <literal>[Install]</literal> |
1115 | section of the unit files. While this command is the recommended way to manipulate the unit configuration | |
1116 | directory, the administrator is free to make additional changes manually by placing or removing symlinks | |
1117 | below this directory. This is particularly useful to create configurations that deviate from the suggested | |
1118 | default installation. In this case, the administrator must make sure to invoke | |
1119 | <command>daemon-reload</command> manually as necessary, in order to ensure the changes are taken into | |
1120 | account. | |
27722f96 LN |
1121 | </para> |
1122 | ||
3990961d LP |
1123 | <para>Enabling units should not be confused with starting (activating) units, as done by the |
1124 | <command>start</command> command. Enabling and starting units is orthogonal: units may be enabled without | |
1125 | being started and started without being enabled. Enabling simply hooks the unit into various suggested | |
1126 | places (for example, so that the unit is automatically started on boot or when a particular kind of | |
1127 | hardware is plugged in). Starting actually spawns the daemon process (in case of service units), or binds | |
1128 | the socket (in case of socket units), and so on.</para> | |
1129 | ||
1130 | <para>Depending on whether <option>--system</option>, <option>--user</option>, <option>--runtime</option>, | |
1131 | or <option>--global</option> is specified, this enables the unit for the system, for the calling user only, | |
1d82e6b3 AJ |
1132 | for only this boot of the system, or for all future logins of all users. Note that in the last case, no |
1133 | systemd daemon configuration is reloaded.</para> | |
3990961d LP |
1134 | |
1135 | <para>Using <command>enable</command> on masked units is not supported and results in an error.</para> | |
27722f96 LN |
1136 | </listitem> |
1137 | </varlistentry> | |
1138 | ||
1139 | <varlistentry> | |
1eecafb8 | 1140 | <term><command>disable <replaceable>NAME</replaceable>…</command></term> |
27722f96 LN |
1141 | |
1142 | <listitem> | |
3990961d LP |
1143 | <para>Disables one or more units. This removes all symlinks to the unit files backing the specified units |
1144 | from the unit configuration directory, and hence undoes any changes made by <command>enable</command> or | |
1145 | <command>link</command>. Note that this removes <emphasis>all</emphasis> symlinks to matching unit files, | |
1146 | including manually created symlinks, and not just those actually created by <command>enable</command> or | |
1147 | <command>link</command>. Note that while <command>disable</command> undoes the effect of | |
1148 | <command>enable</command>, the two commands are otherwise not symmetric, as <command>disable</command> may | |
1149 | remove more symlinks than a prior <command>enable</command> invocation of the same unit created.</para> | |
1150 | ||
1151 | <para>This command expects valid unit names only, it does not accept paths to unit files.</para> | |
1152 | ||
1153 | <para>In addition to the units specified as arguments, all units are disabled that are listed in the | |
1154 | <varname>Also=</varname> setting contained in the <literal>[Install]</literal> section of any of the unit | |
1155 | files being operated on.</para> | |
1156 | ||
1157 | <para>This command implicitly reloads the system manager configuration after completing the operation. Note | |
1158 | that this command does not implicitly stop the units that are being disabled. If this is desired, either | |
1159 | combine this command with the <option>--now</option> switch, or invoke the <command>stop</command> command | |
1160 | with appropriate arguments later.</para> | |
1161 | ||
1162 | <para>This command will print information about the file system operations (symlink removals) | |
1163 | executed. This output may be suppressed by passing <option>--quiet</option>. | |
27722f96 LN |
1164 | </para> |
1165 | ||
3990961d LP |
1166 | <para>This command honors <option>--system</option>, <option>--user</option>, <option>--runtime</option> |
1167 | and <option>--global</option> in a similar way as <command>enable</command>.</para> | |
27722f96 LN |
1168 | </listitem> |
1169 | </varlistentry> | |
1170 | ||
b619ec8f | 1171 | <varlistentry> |
1eecafb8 | 1172 | <term><command>reenable <replaceable>NAME</replaceable>…</command></term> |
b619ec8f LP |
1173 | |
1174 | <listitem> | |
3990961d LP |
1175 | <para>Reenable one or more units, as specified on the command line. This is a combination of |
1176 | <command>disable</command> and <command>enable</command> and is useful to reset the symlinks a unit file is | |
d903a892 | 1177 | enabled with to the defaults configured in its <literal>[Install]</literal> section. This command expects |
1178 | a unit name only, it does not accept paths to unit files.</para> | |
b619ec8f LP |
1179 | </listitem> |
1180 | </varlistentry> | |
1181 | ||
1182 | <varlistentry> | |
1eecafb8 | 1183 | <term><command>preset <replaceable>NAME</replaceable>…</command></term> |
b619ec8f LP |
1184 | |
1185 | <listitem> | |
39207373 ZJS |
1186 | <para>Reset the enable/disable status one or more unit files, as specified on |
1187 | the command line, to the defaults configured in the preset policy files. This | |
1188 | has the same effect as <command>disable</command> or | |
1189 | <command>enable</command>, depending how the unit is listed in the preset | |
1190 | files.</para> | |
b619ec8f | 1191 | |
39207373 ZJS |
1192 | <para>Use <option>--preset-mode=</option> to control whether units shall be |
1193 | enabled and disabled, or only enabled, or only disabled.</para> | |
1194 | ||
1195 | <para>If the unit carries no install information, it will be silently ignored | |
d923e42e ZJS |
1196 | by this command. <replaceable>NAME</replaceable> must be the real unit name, |
1197 | any alias names are ignored silently.</para> | |
b619ec8f | 1198 | |
39207373 | 1199 | <para>For more information on the preset policy format, see |
b619ec8f | 1200 | <citerefentry><refentrytitle>systemd.preset</refentrytitle><manvolnum>5</manvolnum></citerefentry>. |
39207373 | 1201 | For more information on the concept of presets, please consult the |
28a0ad81 | 1202 | <ulink url="https://www.freedesktop.org/wiki/Software/systemd/Preset">Preset</ulink> |
b619ec8f LP |
1203 | document.</para> |
1204 | </listitem> | |
1205 | </varlistentry> | |
1206 | ||
1207 | <varlistentry> | |
1208 | <term><command>preset-all</command></term> | |
1209 | ||
1210 | <listitem> | |
1211 | <para>Resets all installed unit files to the defaults | |
1212 | configured in the preset policy file (see above).</para> | |
1213 | ||
1214 | <para>Use <option>--preset-mode=</option> to control | |
1215 | whether units shall be enabled and disabled, or only | |
1216 | enabled, or only disabled.</para> | |
1217 | </listitem> | |
1218 | </varlistentry> | |
1219 | ||
27722f96 | 1220 | <varlistentry> |
1eecafb8 | 1221 | <term><command>is-enabled <replaceable>NAME</replaceable>…</command></term> |
27722f96 LN |
1222 | |
1223 | <listitem> | |
1224 | <para>Checks whether any of the specified unit files are | |
171754aa ZJS |
1225 | enabled (as with <command>enable</command>). Returns an |
1226 | exit code of 0 if at least one is enabled, non-zero | |
1227 | otherwise. Prints the current enable status (see table). | |
1228 | To suppress this output, use <option>--quiet</option>. | |
3b3557c4 | 1229 | To show installation targets, use <option>--full</option>. |
171754aa ZJS |
1230 | </para> |
1231 | ||
1232 | <table> | |
1233 | <title> | |
1234 | <command>is-enabled</command> output | |
1235 | </title> | |
1236 | ||
1237 | <tgroup cols='3'> | |
1238 | <thead> | |
1239 | <row> | |
94f099d8 LP |
1240 | <entry>Name</entry> |
1241 | <entry>Description</entry> | |
1242 | <entry>Exit Code</entry> | |
171754aa ZJS |
1243 | </row> |
1244 | </thead> | |
1245 | <tbody> | |
1246 | <row> | |
1247 | <entry><literal>enabled</literal></entry> | |
5cd8ae31 | 1248 | <entry morerows='1'>Enabled via <filename>.wants/</filename>, <filename>.requires/</filename> or <varname>Alias=</varname> symlinks (permanently in <filename>/etc/systemd/system/</filename>, or transiently in <filename>/run/systemd/system/</filename>).</entry> |
171754aa ZJS |
1249 | <entry morerows='1'>0</entry> |
1250 | </row> | |
1251 | <row> | |
1252 | <entry><literal>enabled-runtime</literal></entry> | |
1253 | </row> | |
1254 | <row> | |
1255 | <entry><literal>linked</literal></entry> | |
48563081 | 1256 | <entry morerows='1'>Made available through one or more symlinks to the unit file (permanently in <filename>/etc/systemd/system/</filename> or transiently in <filename>/run/systemd/system/</filename>), even though the unit file might reside outside of the unit file search path.</entry> |
94f099d8 | 1257 | <entry morerows='1'>> 0</entry> |
171754aa ZJS |
1258 | </row> |
1259 | <row> | |
1260 | <entry><literal>linked-runtime</literal></entry> | |
1261 | </row> | |
1262 | <row> | |
1263 | <entry><literal>masked</literal></entry> | |
48563081 | 1264 | <entry morerows='1'>Completely disabled, so that any start operation on it fails (permanently in <filename>/etc/systemd/system/</filename> or transiently in <filename>/run/systemd/systemd/</filename>).</entry> |
94f099d8 | 1265 | <entry morerows='1'>> 0</entry> |
171754aa ZJS |
1266 | </row> |
1267 | <row> | |
1268 | <entry><literal>masked-runtime</literal></entry> | |
1269 | </row> | |
1270 | <row> | |
1271 | <entry><literal>static</literal></entry> | |
f4139308 | 1272 | <entry>The unit file is not enabled, and has no provisions for enabling in the <literal>[Install]</literal> unit file section.</entry> |
91f0ac7d | 1273 | <entry>0</entry> |
171754aa | 1274 | </row> |
aedd4012 JS |
1275 | <row> |
1276 | <entry><literal>indirect</literal></entry> | |
d9b4b48f | 1277 | <entry>The unit file itself is not enabled, but it has a non-empty <varname>Also=</varname> setting in the <literal>[Install]</literal> unit file section, listing other unit files that might be enabled, or it has an alias under a different name through a symlink that is not specified in Also=. For template unit file, an instance different than the one specified in <varname>DefaultInstance=</varname> is enabled.</entry> |
aedd4012 JS |
1278 | <entry>0</entry> |
1279 | </row> | |
171754aa ZJS |
1280 | <row> |
1281 | <entry><literal>disabled</literal></entry> | |
f4139308 | 1282 | <entry>The unit file is not enabled, but contains an <literal>[Install]</literal> section with installation instructions.</entry> |
94f099d8 | 1283 | <entry>> 0</entry> |
171754aa | 1284 | </row> |
f4139308 LP |
1285 | <row> |
1286 | <entry><literal>generated</literal></entry> | |
1287 | <entry>The unit file was generated dynamically via a generator tool. See <citerefentry><refentrytitle>systemd.generator</refentrytitle><manvolnum>7</manvolnum></citerefentry>. Generated unit files may not be enabled, they are enabled implicitly by their generator.</entry> | |
1288 | <entry>0</entry> | |
1289 | </row> | |
e4fca67f LP |
1290 | <row> |
1291 | <entry><literal>transient</literal></entry> | |
1292 | <entry>The unit file has been created dynamically with the runtime API. Transient units may not be enabled.</entry> | |
1293 | <entry>0</entry> | |
1294 | </row> | |
0ec0deaa LP |
1295 | <row> |
1296 | <entry><literal>bad</literal></entry> | |
f4139308 | 1297 | <entry>The unit file is invalid or another error occurred. Note that <command>is-enabled</command> will not actually return this state, but print an error message instead. However the unit file listing printed by <command>list-unit-files</command> might show it.</entry> |
0ec0deaa LP |
1298 | <entry>> 0</entry> |
1299 | </row> | |
171754aa ZJS |
1300 | </tbody> |
1301 | </tgroup> | |
1302 | </table> | |
1303 | ||
27722f96 LN |
1304 | </listitem> |
1305 | </varlistentry> | |
1306 | ||
27722f96 | 1307 | <varlistentry> |
1eecafb8 | 1308 | <term><command>mask <replaceable>NAME</replaceable>…</command></term> |
27722f96 LN |
1309 | |
1310 | <listitem> | |
3990961d LP |
1311 | <para>Mask one or more units, as specified on the command line. This will link these unit files to |
1312 | <filename>/dev/null</filename>, making it impossible to start them. This is a stronger version of | |
1313 | <command>disable</command>, since it prohibits all kinds of activation of the unit, including enablement | |
1314 | and manual activation. Use this option with care. This honors the <option>--runtime</option> option to only | |
1315 | mask temporarily until the next reboot of the system. The <option>--now</option> option may be used to | |
1316 | ensure that the units are also stopped. This command expects valid unit names only, it does not accept unit | |
1317 | file paths.</para> | |
27722f96 LN |
1318 | </listitem> |
1319 | </varlistentry> | |
1320 | ||
1321 | <varlistentry> | |
1eecafb8 | 1322 | <term><command>unmask <replaceable>NAME</replaceable>…</command></term> |
27722f96 LN |
1323 | |
1324 | <listitem> | |
3990961d LP |
1325 | <para>Unmask one or more unit files, as specified on the command line. This will undo the effect of |
1326 | <command>mask</command>. This command expects valid unit names only, it does not accept unit file | |
1327 | paths.</para> | |
27722f96 LN |
1328 | </listitem> |
1329 | </varlistentry> | |
1330 | ||
1331 | <varlistentry> | |
1eecafb8 | 1332 | <term><command>link <replaceable>PATH</replaceable>…</command></term> |
27722f96 LN |
1333 | |
1334 | <listitem> | |
3990961d LP |
1335 | <para>Link a unit file that is not in the unit file search paths into the unit file search path. This |
1336 | command expects an absolute path to a unit file. The effect of this may be undone with | |
1337 | <command>disable</command>. The effect of this command is that a unit file is made available for commands | |
1338 | such as <command>start</command>, even though it is not installed directly in the unit search path.</para> | |
27722f96 LN |
1339 | </listitem> |
1340 | </varlistentry> | |
1341 | ||
344ca755 | 1342 | <varlistentry> |
1eecafb8 | 1343 | <term><command>revert <replaceable>NAME</replaceable>…</command></term> |
344ca755 LP |
1344 | |
1345 | <listitem> | |
1346 | <para>Revert one or more unit files to their vendor versions. This command removes drop-in configuration | |
1347 | files that modify the specified units, as well as any user-configured unit file that overrides a matching | |
1348 | vendor supplied unit file. Specifically, for a unit <literal>foo.service</literal> the matching directories | |
1349 | <literal>foo.service.d/</literal> with all their contained files are removed, both below the persistent and | |
1350 | runtime configuration directories (i.e. below <filename>/etc/systemd/system</filename> and | |
1351 | <filename>/run/systemd/system</filename>); if the unit file has a vendor-supplied version (i.e. a unit file | |
b17649ee | 1352 | located below <filename>/usr</filename>) any matching persistent or runtime unit file that overrides it is |
344ca755 LP |
1353 | removed, too. Note that if a unit file has no vendor-supplied version (i.e. is only defined below |
1354 | <filename>/etc/systemd/system</filename> or <filename>/run/systemd/system</filename>, but not in a unit | |
1355 | file stored below <filename>/usr</filename>), then it is not removed. Also, if a unit is masked, it is | |
1356 | unmasked.</para> | |
1357 | ||
1358 | <para>Effectively, this command may be used to undo all changes made with <command>systemctl | |
1359 | edit</command>, <command>systemctl set-property</command> and <command>systemctl mask</command> and puts | |
1360 | the original unit file with its settings back in effect.</para> | |
1361 | </listitem> | |
1362 | </varlistentry> | |
1363 | ||
27722f96 | 1364 | <varlistentry> |
b619ec8f | 1365 | <term><command>add-wants <replaceable>TARGET</replaceable> |
1eecafb8 | 1366 | <replaceable>NAME</replaceable>…</command></term> |
b619ec8f | 1367 | <term><command>add-requires <replaceable>TARGET</replaceable> |
1eecafb8 | 1368 | <replaceable>NAME</replaceable>…</command></term> |
27722f96 LN |
1369 | |
1370 | <listitem> | |
853382da | 1371 | <para>Adds <literal>Wants=</literal> or <literal>Requires=</literal> |
a8eaaee7 | 1372 | dependencies, respectively, to the specified |
853382da | 1373 | <replaceable>TARGET</replaceable> for one or more units. </para> |
27722f96 | 1374 | |
b619ec8f LP |
1375 | <para>This command honors <option>--system</option>, |
1376 | <option>--user</option>, <option>--runtime</option> and | |
a8eaaee7 | 1377 | <option>--global</option> in a way similar to |
b619ec8f | 1378 | <command>enable</command>.</para> |
27722f96 | 1379 | |
27722f96 LN |
1380 | </listitem> |
1381 | </varlistentry> | |
7d4fb3b1 RC |
1382 | |
1383 | <varlistentry> | |
1eecafb8 | 1384 | <term><command>edit <replaceable>NAME</replaceable>…</command></term> |
7d4fb3b1 RC |
1385 | |
1386 | <listitem> | |
1387 | <para>Edit a drop-in snippet or a whole replacement file if | |
1388 | <option>--full</option> is specified, to extend or override the | |
1389 | specified unit.</para> | |
1390 | ||
1391 | <para>Depending on whether <option>--system</option> (the default), | |
1392 | <option>--user</option>, or <option>--global</option> is specified, | |
a8eaaee7 | 1393 | this command creates a drop-in file for each unit either for the system, |
b938cb90 | 1394 | for the calling user, or for all futures logins of all users. Then, |
7d4fb3b1 RC |
1395 | the editor (see the "Environment" section below) is invoked on |
1396 | temporary files which will be written to the real location if the | |
1397 | editor exits successfully.</para> | |
1398 | ||
1399 | <para>If <option>--full</option> is specified, this will copy the | |
1400 | original units instead of creating drop-in files.</para> | |
1401 | ||
39c38ce1 DC |
1402 | <para>If <option>--force</option> is specified and any units do |
1403 | not already exist, new unit files will be opened for editing.</para> | |
1404 | ||
7d4fb3b1 RC |
1405 | <para>If <option>--runtime</option> is specified, the changes will |
1406 | be made temporarily in <filename>/run</filename> and they will be | |
1407 | lost on the next reboot.</para> | |
1408 | ||
b938cb90 JE |
1409 | <para>If the temporary file is empty upon exit, the modification of |
1410 | the related unit is canceled.</para> | |
7d4fb3b1 RC |
1411 | |
1412 | <para>After the units have been edited, systemd configuration is | |
1413 | reloaded (in a way that is equivalent to <command>daemon-reload</command>). | |
1414 | </para> | |
1415 | ||
1416 | <para>Note that this command cannot be used to remotely edit units | |
1417 | and that you cannot temporarily edit units which are in | |
b938cb90 | 1418 | <filename>/etc</filename>, since they take precedence over |
7d4fb3b1 RC |
1419 | <filename>/run</filename>.</para> |
1420 | </listitem> | |
1421 | </varlistentry> | |
b619ec8f LP |
1422 | |
1423 | <varlistentry> | |
1424 | <term><command>get-default</command></term> | |
1425 | ||
1426 | <listitem> | |
1427 | <para>Return the default target to boot into. This returns | |
1428 | the target unit name <filename>default.target</filename> | |
1429 | is aliased (symlinked) to.</para> | |
1430 | </listitem> | |
1431 | </varlistentry> | |
1432 | ||
1433 | <varlistentry> | |
1434 | <term><command>set-default <replaceable>NAME</replaceable></command></term> | |
1435 | ||
1436 | <listitem> | |
1437 | <para>Set the default target to boot into. This sets | |
1438 | (symlinks) the <filename>default.target</filename> alias | |
1439 | to the given target unit.</para> | |
1440 | </listitem> | |
1441 | </varlistentry> | |
1442 | ||
27722f96 LN |
1443 | </variablelist> |
1444 | </refsect2> | |
1445 | ||
0d292f5e LP |
1446 | <refsect2> |
1447 | <title>Machine Commands</title> | |
1448 | ||
1449 | <variablelist> | |
1450 | <varlistentry> | |
1eecafb8 | 1451 | <term><command>list-machines <optional><replaceable>PATTERN</replaceable>…</optional></command></term> |
0d292f5e LP |
1452 | |
1453 | <listitem> | |
1454 | <para>List the host and all running local containers with | |
1455 | their state. If one or more | |
1456 | <replaceable>PATTERN</replaceable>s are specified, only | |
1457 | containers matching one of them are shown. | |
1458 | </para> | |
1459 | </listitem> | |
1460 | </varlistentry> | |
1461 | </variablelist> | |
1462 | </refsect2> | |
1463 | ||
27722f96 LN |
1464 | <refsect2> |
1465 | <title>Job Commands</title> | |
1466 | ||
1467 | <variablelist> | |
1468 | <varlistentry> | |
1eecafb8 | 1469 | <term><command>list-jobs <optional><replaceable>PATTERN…</replaceable></optional></command></term> |
27722f96 LN |
1470 | |
1471 | <listitem> | |
d8fba7c6 ZJS |
1472 | <para>List jobs that are in progress. If one or more |
1473 | <replaceable>PATTERN</replaceable>s are specified, only | |
1474 | jobs for units matching one of them are shown.</para> | |
82948f6c LP |
1475 | |
1476 | <para>When combined with <option>--after</option> or <option>--before</option> the list is augmented with | |
1477 | information on which other job each job is waiting for, and which other jobs are waiting for it, see | |
1478 | above.</para> | |
27722f96 LN |
1479 | </listitem> |
1480 | </varlistentry> | |
1481 | <varlistentry> | |
1eecafb8 | 1482 | <term><command>cancel <replaceable>JOB</replaceable>…</command></term> |
27722f96 LN |
1483 | |
1484 | <listitem> | |
1485 | <para>Cancel one or more jobs specified on the command line | |
1486 | by their numeric job IDs. If no job ID is specified, cancel | |
1487 | all pending jobs.</para> | |
1488 | </listitem> | |
1489 | </varlistentry> | |
1490 | </variablelist> | |
27722f96 LN |
1491 | </refsect2> |
1492 | ||
1493 | <refsect2> | |
1494 | <title>Environment Commands</title> | |
1495 | ||
1496 | <variablelist> | |
1497 | <varlistentry> | |
1498 | <term><command>show-environment</command></term> | |
1499 | ||
1500 | <listitem> | |
804ee07c ZJS |
1501 | <para>Dump the systemd manager environment block. This is the environment |
1502 | block that is passed to all processes the manager spawns. The environment | |
1503 | block will be dumped in straight-forward form suitable for sourcing into | |
1504 | most shells. If no special characters or whitespace is present in the variable | |
1505 | values, no escaping is performed, and the assignments have the form | |
1506 | <literal>VARIABLE=value</literal>. If whitespace or characters which have | |
1507 | special meaning to the shell are present, dollar-single-quote escaping is | |
1508 | used, and assignments have the form <literal>VARIABLE=$'value'</literal>. | |
1509 | This syntax is known to be supported by | |
1510 | <citerefentry project='die-net'><refentrytitle>bash</refentrytitle><manvolnum>1</manvolnum></citerefentry>, | |
1511 | <citerefentry project='die-net'><refentrytitle>zsh</refentrytitle><manvolnum>1</manvolnum></citerefentry>, | |
1512 | <citerefentry project='die-net'><refentrytitle>ksh</refentrytitle><manvolnum>1</manvolnum></citerefentry>, | |
1513 | and | |
1514 | <citerefentry project='die-net'><refentrytitle>busybox</refentrytitle><manvolnum>1</manvolnum></citerefentry>'s | |
1515 | <citerefentry project='die-net'><refentrytitle>ash</refentrytitle><manvolnum>1</manvolnum></citerefentry>, | |
1516 | but not | |
1517 | <citerefentry project='die-net'><refentrytitle>dash</refentrytitle><manvolnum>1</manvolnum></citerefentry> | |
1518 | or | |
1519 | <citerefentry project='die-net'><refentrytitle>fish</refentrytitle><manvolnum>1</manvolnum></citerefentry>. | |
1520 | </para> | |
27722f96 LN |
1521 | </listitem> |
1522 | </varlistentry> | |
1523 | <varlistentry> | |
1eecafb8 | 1524 | <term><command>set-environment <replaceable>VARIABLE=VALUE</replaceable>…</command></term> |
27722f96 LN |
1525 | |
1526 | <listitem> | |
1527 | <para>Set one or more systemd manager environment variables, | |
1528 | as specified on the command line.</para> | |
1529 | </listitem> | |
1530 | </varlistentry> | |
1531 | <varlistentry> | |
1eecafb8 | 1532 | <term><command>unset-environment <replaceable>VARIABLE</replaceable>…</command></term> |
27722f96 LN |
1533 | |
1534 | <listitem> | |
1535 | <para>Unset one or more systemd manager environment | |
1536 | variables. If only a variable name is specified, it will be | |
1537 | removed regardless of its value. If a variable and a value | |
1538 | are specified, the variable is only removed if it has the | |
1539 | specified value.</para> | |
1540 | </listitem> | |
ac3efa8a LP |
1541 | </varlistentry> |
1542 | <varlistentry> | |
3fb90db2 | 1543 | <term> |
b975b0d5 | 1544 | <command>import-environment</command> |
1eecafb8 | 1545 | <optional><replaceable>VARIABLE…</replaceable></optional> |
b975b0d5 | 1546 | </term> |
ac3efa8a LP |
1547 | |
1548 | <listitem> | |
1549 | <para>Import all, one or more environment variables set on | |
1550 | the client into the systemd manager environment block. If | |
73e231ab JE |
1551 | no arguments are passed, the entire environment block is |
1552 | imported. Otherwise, a list of one or more environment | |
1553 | variable names should be passed, whose client-side values | |
ac3efa8a LP |
1554 | are then imported into the manager's environment |
1555 | block.</para> | |
1556 | </listitem> | |
27722f96 LN |
1557 | </varlistentry> |
1558 | </variablelist> | |
1559 | </refsect2> | |
1560 | ||
1561 | <refsect2> | |
1562 | <title>Manager Lifecycle Commands</title> | |
1563 | ||
1564 | <variablelist> | |
1565 | <varlistentry> | |
1566 | <term><command>daemon-reload</command></term> | |
1567 | ||
1568 | <listitem> | |
a8eaaee7 | 1569 | <para>Reload the systemd manager configuration. This will |
432d5965 ZJS |
1570 | rerun all generators (see |
1571 | <citerefentry><refentrytitle>systemd.generator</refentrytitle><manvolnum>7</manvolnum></citerefentry>), | |
1572 | reload all unit files, and recreate the entire dependency | |
1573 | tree. While the daemon is being reloaded, all sockets | |
1574 | systemd listens on behalf of user configuration will stay | |
1575 | accessible.</para> | |
1576 | ||
1577 | <para>This command should not be confused with the | |
1578 | <command>reload</command> command.</para> | |
27722f96 LN |
1579 | </listitem> |
1580 | </varlistentry> | |
1581 | <varlistentry> | |
1582 | <term><command>daemon-reexec</command></term> | |
1583 | ||
1584 | <listitem> | |
1585 | <para>Reexecute the systemd manager. This will serialize the | |
1586 | manager state, reexecute the process and deserialize the | |
1587 | state again. This command is of little use except for | |
79640424 | 1588 | debugging and package upgrades. Sometimes, it might be |
27722f96 | 1589 | helpful as a heavy-weight <command>daemon-reload</command>. |
79640424 | 1590 | While the daemon is being reexecuted, all sockets systemd listening |
27722f96 LN |
1591 | on behalf of user configuration will stay accessible. |
1592 | </para> | |
1593 | </listitem> | |
1594 | </varlistentry> | |
1595 | </variablelist> | |
1596 | </refsect2> | |
1597 | ||
1598 | <refsect2> | |
1599 | <title>System Commands</title> | |
1600 | ||
1601 | <variablelist> | |
99813a19 LP |
1602 | <varlistentry> |
1603 | <term><command>is-system-running</command></term> | |
1604 | ||
1605 | <listitem> | |
2de51fdc | 1606 | <para>Checks whether the system is operational. This |
94f099d8 LP |
1607 | returns success (exit code 0) when the system is fully up |
1608 | and running, specifically not in startup, shutdown or | |
1609 | maintenance mode, and with no failed services. Failure is | |
1610 | returned otherwise (exit code non-zero). In addition, the | |
2de51fdc | 1611 | current state is printed in a short string to standard |
a8eaaee7 | 1612 | output, see the table below. Use <option>--quiet</option> to |
2de51fdc ZJS |
1613 | suppress this output.</para> |
1614 | ||
1615 | <table> | |
94f099d8 LP |
1616 | <title><command>is-system-running</command> output</title> |
1617 | <tgroup cols='3'> | |
1618 | <colspec colname='name'/> | |
1619 | <colspec colname='description'/> | |
1620 | <colspec colname='exit-code'/> | |
2de51fdc ZJS |
1621 | <thead> |
1622 | <row> | |
1623 | <entry>Name</entry> | |
1624 | <entry>Description</entry> | |
94f099d8 | 1625 | <entry>Exit Code</entry> |
2de51fdc ZJS |
1626 | </row> |
1627 | </thead> | |
1628 | <tbody> | |
1629 | <row> | |
1630 | <entry><varname>initializing</varname></entry> | |
1631 | <entry><para>Early bootup, before | |
1fdfa094 LP |
1632 | <filename>basic.target</filename> is reached |
1633 | or the <varname>maintenance</varname> state entered. | |
2de51fdc | 1634 | </para></entry> |
94f099d8 | 1635 | <entry>> 0</entry> |
2de51fdc ZJS |
1636 | </row> |
1637 | <row> | |
1638 | <entry><varname>starting</varname></entry> | |
1fdfa094 LP |
1639 | <entry><para>Late bootup, before the job queue |
1640 | becomes idle for the first time, or one of the | |
1641 | rescue targets are reached.</para></entry> | |
94f099d8 | 1642 | <entry>> 0</entry> |
2de51fdc ZJS |
1643 | </row> |
1644 | <row> | |
1645 | <entry><varname>running</varname></entry> | |
1646 | <entry><para>The system is fully | |
1647 | operational.</para></entry> | |
94f099d8 | 1648 | <entry>0</entry> |
2de51fdc ZJS |
1649 | </row> |
1650 | <row> | |
1651 | <entry><varname>degraded</varname></entry> | |
1652 | <entry><para>The system is operational but one or more | |
1653 | units failed.</para></entry> | |
94f099d8 | 1654 | <entry>> 0</entry> |
2de51fdc ZJS |
1655 | </row> |
1656 | <row> | |
1657 | <entry><varname>maintenance</varname></entry> | |
1fdfa094 | 1658 | <entry><para>The rescue or emergency target is |
2de51fdc | 1659 | active.</para></entry> |
94f099d8 | 1660 | <entry>> 0</entry> |
2de51fdc ZJS |
1661 | </row> |
1662 | <row> | |
1663 | <entry><varname>stopping</varname></entry> | |
1664 | <entry><para>The manager is shutting | |
1665 | down.</para></entry> | |
94f099d8 LP |
1666 | <entry>> 0</entry> |
1667 | </row> | |
1668 | <row> | |
1669 | <entry><varname>offline</varname></entry> | |
1670 | <entry><para>The manager is not | |
1671 | running. Specifically, this is the operational | |
1672 | state if an incompatible program is running as | |
1673 | system manager (PID 1).</para></entry> | |
1674 | <entry>> 0</entry> | |
1675 | </row> | |
1676 | <row> | |
1677 | <entry><varname>unknown</varname></entry> | |
1678 | <entry><para>The operational state could not be | |
1679 | determined, due to lack of resources or another | |
1680 | error cause.</para></entry> | |
1681 | <entry>> 0</entry> | |
2de51fdc ZJS |
1682 | </row> |
1683 | </tbody> | |
1684 | </tgroup> | |
1685 | </table> | |
99813a19 LP |
1686 | </listitem> |
1687 | </varlistentry> | |
1688 | ||
27722f96 LN |
1689 | <varlistentry> |
1690 | <term><command>default</command></term> | |
1691 | ||
1692 | <listitem> | |
1693 | <para>Enter default mode. This is mostly equivalent to | |
1694 | <command>isolate default.target</command>.</para> | |
1695 | </listitem> | |
1696 | </varlistentry> | |
99813a19 | 1697 | |
27722f96 LN |
1698 | <varlistentry> |
1699 | <term><command>rescue</command></term> | |
1700 | ||
1701 | <listitem> | |
1702 | <para>Enter rescue mode. This is mostly equivalent to | |
1703 | <command>isolate rescue.target</command>, but also prints a | |
1704 | wall message to all users.</para> | |
1705 | </listitem> | |
1706 | </varlistentry> | |
1707 | <varlistentry> | |
1708 | <term><command>emergency</command></term> | |
1709 | ||
1710 | <listitem> | |
1711 | <para>Enter emergency mode. This is mostly equivalent to | |
1712 | <command>isolate emergency.target</command>, but also prints | |
1713 | a wall message to all users.</para> | |
1714 | </listitem> | |
1715 | </varlistentry> | |
1716 | <varlistentry> | |
1717 | <term><command>halt</command></term> | |
1718 | ||
1719 | <listitem> | |
924e44b4 LP |
1720 | <para>Shut down and halt the system. This is mostly equivalent to <command>start halt.target |
1721 | --job-mode=replace-irreversibly</command>, but also prints a wall message to all users. If combined with | |
1722 | <option>--force</option>, shutdown of all running services is skipped, however all processes are killed and | |
1723 | all file systems are unmounted or mounted read-only, immediately followed by the system halt. If | |
1724 | <option>--force</option> is specified twice, the operation is immediately executed without terminating any | |
1725 | processes or unmounting any file systems. This may result in data loss. Note that when | |
1726 | <option>--force</option> is specified twice the halt operation is executed by | |
1727 | <command>systemctl</command> itself, and the system manager is not contacted. This means the command should | |
1728 | succeed even when the system manager hangs or crashed.</para> | |
27722f96 LN |
1729 | </listitem> |
1730 | </varlistentry> | |
1731 | <varlistentry> | |
1732 | <term><command>poweroff</command></term> | |
1733 | ||
1734 | <listitem> | |
924e44b4 LP |
1735 | <para>Shut down and power-off the system. This is mostly equivalent to <command>start poweroff.target |
1736 | --job-mode=replace-irreversibly</command>, but also prints a wall message to all users. If combined with | |
1737 | <option>--force</option>, shutdown of all running services is skipped, however all processes are killed and | |
1738 | all file systems are unmounted or mounted read-only, immediately followed by the powering off. If | |
1739 | <option>--force</option> is specified twice, the operation is immediately executed without terminating any | |
1740 | processes or unmounting any file systems. This may result in data loss. Note that when | |
1741 | <option>--force</option> is specified twice the power-off operation is executed by | |
1742 | <command>systemctl</command> itself, and the system manager is not contacted. This means the command should | |
1743 | succeed even when the system manager hangs or crashed.</para> | |
27722f96 LN |
1744 | </listitem> |
1745 | </varlistentry> | |
1746 | <varlistentry> | |
37185ec8 | 1747 | <term><command>reboot <optional><replaceable>arg</replaceable></optional></command></term> |
27722f96 LN |
1748 | |
1749 | <listitem> | |
924e44b4 LP |
1750 | <para>Shut down and reboot the system. This is mostly equivalent to <command>start reboot.target |
1751 | --job-mode=replace-irreversibly</command>, but also prints a wall message to all users. If combined with | |
1752 | <option>--force</option>, shutdown of all running services is skipped, however all processes are killed and | |
1753 | all file systems are unmounted or mounted read-only, immediately followed by the reboot. If | |
1754 | <option>--force</option> is specified twice, the operation is immediately executed without terminating any | |
1755 | processes or unmounting any file systems. This may result in data loss. Note that when | |
1756 | <option>--force</option> is specified twice the reboot operation is executed by | |
1757 | <command>systemctl</command> itself, and the system manager is not contacted. This means the command should | |
1758 | succeed even when the system manager hangs or crashed.</para> | |
37185ec8 WC |
1759 | |
1760 | <para>If the optional argument | |
1761 | <replaceable>arg</replaceable> is given, it will be passed | |
1762 | as the optional argument to the | |
1763 | <citerefentry><refentrytitle>reboot</refentrytitle><manvolnum>2</manvolnum></citerefentry> | |
1764 | system call. The value is architecture and firmware | |
1765 | specific. As an example, <literal>recovery</literal> might | |
1766 | be used to trigger system recovery, and | |
1767 | <literal>fota</literal> might be used to trigger a | |
1768 | <quote>firmware over the air</quote> update.</para> | |
27722f96 LN |
1769 | </listitem> |
1770 | </varlistentry> | |
b619ec8f | 1771 | |
27722f96 LN |
1772 | <varlistentry> |
1773 | <term><command>kexec</command></term> | |
1774 | ||
1775 | <listitem> | |
1776 | <para>Shut down and reboot the system via kexec. This is | |
903e7c37 | 1777 | mostly equivalent to <command>start kexec.target --job-mode=replace-irreversibly</command>, |
27722f96 LN |
1778 | but also prints a wall message to all users. If combined |
1779 | with <option>--force</option>, shutdown of all running | |
1780 | services is skipped, however all processes are killed and | |
1781 | all file systems are unmounted or mounted read-only, | |
1782 | immediately followed by the reboot.</para> | |
1783 | </listitem> | |
1784 | </varlistentry> | |
b619ec8f | 1785 | |
27722f96 | 1786 | <varlistentry> |
287419c1 | 1787 | <term><command>exit <optional><replaceable>EXIT_CODE</replaceable></optional></command></term> |
27722f96 LN |
1788 | |
1789 | <listitem> | |
1790 | <para>Ask the systemd manager to quit. This is only | |
1791 | supported for user service managers (i.e. in conjunction | |
287419c1 AC |
1792 | with the <option>--user</option> option) or in containers |
1793 | and is equivalent to <command>poweroff</command> otherwise.</para> | |
1794 | ||
1795 | <para>The systemd manager can exit with a non-zero exit | |
1796 | code if the optional argument | |
1797 | <replaceable>EXIT_CODE</replaceable> is given.</para> | |
27722f96 | 1798 | </listitem> |
b619ec8f | 1799 | </varlistentry> |
27722f96 | 1800 | |
b619ec8f LP |
1801 | <varlistentry> |
1802 | <term><command>switch-root <replaceable>ROOT</replaceable> <optional><replaceable>INIT</replaceable></optional></command></term> | |
1803 | ||
1804 | <listitem> | |
fb1bad9d LP |
1805 | <para>Switches to a different root directory and executes a new system manager process below it. This is |
1806 | intended for usage in initial RAM disks ("initrd"), and will transition from the initrd's system manager | |
1807 | process (a.k.a. "init" process) to the main system manager process which is loaded from the actual host | |
1808 | volume. This call takes two arguments: the directory that is to become the new root directory, and the path | |
1809 | to the new system manager binary below it to execute as PID 1. If the latter is omitted or the empty | |
1810 | string, a systemd binary will automatically be searched for and used as init. If the system manager path is | |
1811 | omitted, equal to the empty string or identical to the path to the systemd binary, the state of the | |
1812 | initrd's system manager process is passed to the main system manager, which allows later introspection of | |
1813 | the state of the services involved in the initrd boot phase.</para> | |
b619ec8f | 1814 | </listitem> |
27722f96 | 1815 | </varlistentry> |
b619ec8f | 1816 | |
27722f96 LN |
1817 | <varlistentry> |
1818 | <term><command>suspend</command></term> | |
1819 | ||
1820 | <listitem> | |
1821 | <para>Suspend the system. This will trigger activation of | |
1822 | the special <filename>suspend.target</filename> target. | |
1823 | </para> | |
1824 | </listitem> | |
1825 | </varlistentry> | |
b619ec8f | 1826 | |
27722f96 LN |
1827 | <varlistentry> |
1828 | <term><command>hibernate</command></term> | |
1829 | ||
1830 | <listitem> | |
1831 | <para>Hibernate the system. This will trigger activation of | |
1832 | the special <filename>hibernate.target</filename> target. | |
1833 | </para> | |
1834 | </listitem> | |
1835 | </varlistentry> | |
b619ec8f | 1836 | |
27722f96 LN |
1837 | <varlistentry> |
1838 | <term><command>hybrid-sleep</command></term> | |
1839 | ||
1840 | <listitem> | |
1841 | <para>Hibernate and suspend the system. This will trigger | |
1842 | activation of the special | |
1843 | <filename>hybrid-sleep.target</filename> target.</para> | |
1844 | </listitem> | |
1845 | </varlistentry> | |
27722f96 LN |
1846 | </variablelist> |
1847 | </refsect2> | |
4a6022f0 | 1848 | |
a7c0e5d7 LP |
1849 | <refsect2> |
1850 | <title>Parameter Syntax</title> | |
1851 | ||
da25e029 | 1852 | <para>Unit commands listed above take either a single unit name (designated as <replaceable>NAME</replaceable>), |
1eecafb8 | 1853 | or multiple unit specifications (designated as <replaceable>PATTERN</replaceable>…). In the first case, the |
da25e029 ZJS |
1854 | unit name with or without a suffix must be given. If the suffix is not specified (unit name is "abbreviated"), |
1855 | systemctl will append a suitable suffix, <literal>.service</literal> by default, and a type-specific suffix in | |
1856 | case of commands which operate only on specific unit types. For example, | |
e3e0314b ZJS |
1857 | <programlisting># systemctl start sshd</programlisting> and |
1858 | <programlisting># systemctl start sshd.service</programlisting> | |
1859 | are equivalent, as are | |
507e28d8 | 1860 | <programlisting># systemctl isolate default</programlisting> |
e3e0314b | 1861 | and |
507e28d8 | 1862 | <programlisting># systemctl isolate default.target</programlisting> |
da25e029 ZJS |
1863 | Note that (absolute) paths to device nodes are automatically converted to device unit names, and other (absolute) |
1864 | paths to mount unit names. | |
e3e0314b ZJS |
1865 | <programlisting># systemctl status /dev/sda |
1866 | # systemctl status /home</programlisting> | |
1867 | are equivalent to: | |
1868 | <programlisting># systemctl status dev-sda.device | |
1869 | # systemctl status home.mount</programlisting> | |
2cdbbc9a | 1870 | In the second case, shell-style globs will be matched against the primary names of all units currently in memory; |
1f00eded LP |
1871 | literal unit names, with or without a suffix, will be treated as in the first case. This means that literal unit |
1872 | names always refer to exactly one unit, but globs may match zero units and this is not considered an | |
1873 | error.</para> | |
e3e0314b ZJS |
1874 | |
1875 | <para>Glob patterns use | |
decde8cd | 1876 | <citerefentry project='man-pages'><refentrytitle>fnmatch</refentrytitle><manvolnum>3</manvolnum></citerefentry>, |
e3e0314b ZJS |
1877 | so normal shell-style globbing rules are used, and |
1878 | <literal>*</literal>, <literal>?</literal>, | |
1879 | <literal>[]</literal> may be used. See | |
decde8cd | 1880 | <citerefentry project='man-pages'><refentrytitle>glob</refentrytitle><manvolnum>7</manvolnum></citerefentry> |
1f00eded | 1881 | for more details. The patterns are matched against the primary names of |
2cdbbc9a | 1882 | units currently in memory, and patterns which do not match anything |
e3e0314b ZJS |
1883 | are silently skipped. For example: |
1884 | <programlisting># systemctl stop sshd@*.service</programlisting> | |
1f00eded | 1885 | will stop all <filename>sshd@.service</filename> instances. Note that alias names of units, and units that aren't |
2cdbbc9a | 1886 | in memory are not considered for glob expansion. |
e3e0314b ZJS |
1887 | </para> |
1888 | ||
1534e170 LP |
1889 | <para>For unit file commands, the specified <replaceable>NAME</replaceable> should be the name of the unit file |
1890 | (possibly abbreviated, see above), or the absolute path to the unit file: | |
e3e0314b ZJS |
1891 | <programlisting># systemctl enable foo.service</programlisting> |
1892 | or | |
1893 | <programlisting># systemctl link /path/to/foo.service</programlisting> | |
1894 | </para> | |
a7c0e5d7 LP |
1895 | </refsect2> |
1896 | ||
4a6022f0 ZJS |
1897 | </refsect1> |
1898 | ||
1899 | <refsect1> | |
1900 | <title>Exit status</title> | |
1901 | ||
7b870f60 | 1902 | <para>On success, 0 is returned, a non-zero failure |
4a6022f0 ZJS |
1903 | code otherwise.</para> |
1904 | </refsect1> | |
1905 | ||
7d4fb3b1 RC |
1906 | <refsect1> |
1907 | <title>Environment</title> | |
1908 | ||
1909 | <variablelist class='environment-variables'> | |
1910 | <varlistentry> | |
1911 | <term><varname>$SYSTEMD_EDITOR</varname></term> | |
1912 | ||
1913 | <listitem><para>Editor to use when editing units; overrides | |
1914 | <varname>$EDITOR</varname> and <varname>$VISUAL</varname>. If neither | |
1915 | <varname>$SYSTEMD_EDITOR</varname> nor <varname>$EDITOR</varname> nor | |
1916 | <varname>$VISUAL</varname> are present or if it is set to an empty | |
1917 | string or if their execution failed, systemctl will try to execute well | |
1918 | known editors in this order: | |
9391a1c3 | 1919 | <citerefentry project='die-net'><refentrytitle>editor</refentrytitle><manvolnum>1</manvolnum></citerefentry>, |
3ba3a79d ZJS |
1920 | <citerefentry project='die-net'><refentrytitle>nano</refentrytitle><manvolnum>1</manvolnum></citerefentry>, |
1921 | <citerefentry project='die-net'><refentrytitle>vim</refentrytitle><manvolnum>1</manvolnum></citerefentry>, | |
1922 | <citerefentry project='die-net'><refentrytitle>vi</refentrytitle><manvolnum>1</manvolnum></citerefentry>. | |
7d4fb3b1 RC |
1923 | </para></listitem> |
1924 | </varlistentry> | |
1925 | </variablelist> | |
1926 | <xi:include href="less-variables.xml" xpointer="pager"/> | |
1927 | <xi:include href="less-variables.xml" xpointer="less"/> | |
6e16066e | 1928 | <xi:include href="less-variables.xml" xpointer="lesscharset"/> |
7d4fb3b1 | 1929 | </refsect1> |
4a6022f0 ZJS |
1930 | |
1931 | <refsect1> | |
1932 | <title>See Also</title> | |
1933 | <para> | |
1934 | <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>, | |
4a6022f0 ZJS |
1935 | <citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>, |
1936 | <citerefentry><refentrytitle>loginctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>, | |
a03fe1a5 | 1937 | <citerefentry><refentrytitle>machinectl</refentrytitle><manvolnum>1</manvolnum></citerefentry>, |
4a6022f0 | 1938 | <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>, |
ee41f602 | 1939 | <citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>, |
4a6022f0 | 1940 | <citerefentry><refentrytitle>systemd.special</refentrytitle><manvolnum>7</manvolnum></citerefentry>, |
5aded369 | 1941 | <citerefentry project='man-pages'><refentrytitle>wall</refentrytitle><manvolnum>1</manvolnum></citerefentry>, |
7d4fb3b1 | 1942 | <citerefentry><refentrytitle>systemd.preset</refentrytitle><manvolnum>5</manvolnum></citerefentry>, |
432d5965 | 1943 | <citerefentry><refentrytitle>systemd.generator</refentrytitle><manvolnum>7</manvolnum></citerefentry>, |
decde8cd | 1944 | <citerefentry project='man-pages'><refentrytitle>glob</refentrytitle><manvolnum>7</manvolnum></citerefentry> |
4a6022f0 ZJS |
1945 | </para> |
1946 | </refsect1> | |
7874bcd6 LP |
1947 | |
1948 | </refentry> |