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