]>
Commit | Line | Data |
---|---|---|
514094f9 | 1 | <?xml version='1.0'?> |
3a54a157 ZJS |
2 | <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" |
3 | "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [ | |
681eb9cf FB |
4 | <!ENTITY % entities SYSTEM "custom-entities.ent" > |
5 | %entities; | |
6 | ]> | |
db9ecf05 | 7 | <!-- SPDX-License-Identifier: LGPL-2.1-or-later --> |
7874bcd6 | 8 | |
21ac6ff1 ZJS |
9 | <refentry id="systemctl" |
10 | xmlns:xi="http://www.w3.org/2001/XInclude"> | |
7874bcd6 | 11 | |
4a6022f0 ZJS |
12 | <refentryinfo> |
13 | <title>systemctl</title> | |
14 | <productname>systemd</productname> | |
4a6022f0 ZJS |
15 | </refentryinfo> |
16 | ||
17 | <refmeta> | |
18 | <refentrytitle>systemctl</refentrytitle> | |
19 | <manvolnum>1</manvolnum> | |
20 | </refmeta> | |
21 | ||
22 | <refnamediv> | |
23 | <refname>systemctl</refname> | |
24 | <refpurpose>Control the systemd system and service manager</refpurpose> | |
25 | </refnamediv> | |
26 | ||
27 | <refsynopsisdiv> | |
28 | <cmdsynopsis> | |
29 | <command>systemctl</command> | |
30 | <arg choice="opt" rep="repeat">OPTIONS</arg> | |
31 | <arg choice="plain">COMMAND</arg> | |
da5e955f | 32 | <arg choice="opt" rep="repeat">UNIT</arg> |
4a6022f0 ZJS |
33 | </cmdsynopsis> |
34 | </refsynopsisdiv> | |
35 | ||
36 | <refsect1> | |
37 | <title>Description</title> | |
38 | ||
a4390b6b LP |
39 | <para><command>systemctl</command> may be used to introspect and |
40 | control the state of the <literal>systemd</literal> system and | |
41 | service manager. Please refer to | |
4a6022f0 | 42 | <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry> |
a4390b6b LP |
43 | for an introduction into the basic concepts and functionality this |
44 | tool manages.</para> | |
4a6022f0 ZJS |
45 | </refsect1> |
46 | ||
47 | <refsect1> | |
e1fac8a6 | 48 | <title>Commands</title> |
4a6022f0 | 49 | |
e1fac8a6 | 50 | <para>The following commands are understood:</para> |
4a6022f0 | 51 | |
e1fac8a6 | 52 | <refsect2> |
172338d5 | 53 | <title>Unit Commands (Introspection and Modification)</title> |
20b3f379 | 54 | |
e1fac8a6 ZJS |
55 | <variablelist> |
56 | <varlistentry> | |
57 | <term><command>list-units</command> <optional><replaceable>PATTERN</replaceable>…</optional></term> | |
4a6022f0 | 58 | |
e1fac8a6 ZJS |
59 | <listitem> |
60 | <para>List units that <command>systemd</command> currently has in memory. This includes units that are | |
61 | either referenced directly or through a dependency, units that are pinned by applications programmatically, | |
62 | or units that were active in the past and have failed. By default only units which are active, have pending | |
63 | jobs, or have failed are shown; this can be changed with option <option>--all</option>. If one or more | |
64 | <replaceable>PATTERN</replaceable>s are specified, only units matching one of them are shown. The units | |
65 | that are shown are additionally filtered by <option>--type=</option> and <option>--state=</option> if those | |
66 | options are specified.</para> | |
4a6022f0 | 67 | |
7ea5e82f LP |
68 | <para>Note that this command does not show unit templates, but only instances of unit |
69 | templates. Units templates that aren't instantiated are not runnable, and will thus never show up | |
70 | in the output of this command. Specifically this means that <filename>foo@.service</filename> | |
71 | will never be shown in this list — unless instantiated, e.g. as | |
72 | <filename>foo@bar.service</filename>. Use <command>list-unit-files</command> (see below) for | |
73 | listing installed unit template files.</para> | |
74 | ||
e1fac8a6 ZJS |
75 | <para>Produces output similar to |
76 | <programlisting> UNIT LOAD ACTIVE SUB DESCRIPTION | |
77 | sys-module-fuse.device loaded active plugged /sys/module/fuse | |
78 | -.mount loaded active mounted Root Mount | |
79 | boot-efi.mount loaded active mounted /boot/efi | |
80 | systemd-journald.service loaded active running Journal Service | |
81 | systemd-logind.service loaded active running Login Service | |
82 | ● user@1000.service loaded failed failed User Manager for UID 1000 | |
83 | … | |
84 | systemd-tmpfiles-clean.timer loaded active waiting Daily Cleanup of Temporary Directories | |
9b9b3d36 | 85 | |
e1fac8a6 ZJS |
86 | LOAD = Reflects whether the unit definition was properly loaded. |
87 | ACTIVE = The high-level unit activation state, i.e. generalization of SUB. | |
88 | SUB = The low-level unit activation state, values depend on unit type. | |
e16972e6 | 89 | |
e1fac8a6 | 90 | 123 loaded units listed. Pass --all to see loaded but inactive units, too. |
7ea5e82f LP |
91 | To show all installed unit files use 'systemctl list-unit-files'.</programlisting></para> |
92 | ||
93 | <para>The header and the last unit of a given type are underlined if the terminal supports | |
94 | that. A colored dot is shown next to services which were masked, not found, or otherwise | |
95 | failed.</para> | |
9b9b3d36 | 96 | |
e1fac8a6 ZJS |
97 | <para>The LOAD column shows the load state, one of <constant>loaded</constant>, |
98 | <constant>not-found</constant>, <constant>bad-setting</constant>, <constant>error</constant>, | |
99 | <constant>masked</constant>. The ACTIVE columns shows the general unit state, one of | |
100 | <constant>active</constant>, <constant>reloading</constant>, <constant>inactive</constant>, | |
101 | <constant>failed</constant>, <constant>activating</constant>, <constant>deactivating</constant>. The SUB | |
102 | column shows the unit-type-specific detailed state of the unit, possible values vary by unit type. The list | |
103 | of possible LOAD, ACTIVE, and SUB states is not constant and new systemd releases may both add and remove | |
104 | values. <programlisting>systemctl --state=help</programlisting> command maybe be used to display the | |
105 | current set of possible values.</para> | |
4a6022f0 | 106 | |
e1fac8a6 ZJS |
107 | <para>This is the default command.</para> |
108 | </listitem> | |
109 | </varlistentry> | |
ea539eb6 | 110 | |
2d5cdc62 DT |
111 | <varlistentry> |
112 | <term><command>list-automounts</command> <optional><replaceable>PATTERN</replaceable>…</optional></term> | |
113 | ||
114 | <listitem> | |
115 | <para>List automount units currently in memory, ordered by mount path. If one or more | |
116 | <replaceable>PATTERN</replaceable>s are specified, only automount units matching one of them are shown. | |
117 | Produces output similar to | |
118 | <programlisting> | |
119 | WHAT WHERE MOUNTED IDLE TIMEOUT UNIT | |
120 | /dev/sdb1 /mnt/test no 120s mnt-test.automount | |
121 | binfmt_misc /proc/sys/fs/binfmt_misc yes 0 proc-sys-fs-binfmt_misc.automount | |
122 | ||
123 | 2 automounts listed.</programlisting> | |
124 | </para> | |
125 | ||
126 | <para>Also see <option>--show-types</option>, <option>--all</option>, and <option>--state=</option>.</para> | |
127 | </listitem> | |
128 | </varlistentry> | |
129 | ||
160b8e98 DT |
130 | <varlistentry> |
131 | <term><command>list-paths</command> <optional><replaceable>PATTERN</replaceable>…</optional></term> | |
132 | ||
133 | <listitem> | |
134 | <para>List path units currently in memory, ordered by path. If one or more | |
135 | <replaceable>PATTERN</replaceable>s are specified, only path units matching one of them are shown. | |
136 | Produces output similar to | |
137 | <programlisting> | |
138 | PATH CONDITION UNIT ACTIVATES | |
139 | /run/systemd/ask-password DirectoryNotEmpty systemd-ask-password-plymouth.path systemd-ask-password-plymouth.service | |
140 | /run/systemd/ask-password DirectoryNotEmpty systemd-ask-password-wall.path systemd-ask-password-wall.service | |
141 | /var/cache/cups/org.cups.cupsd PathExists cups.path cups.service | |
142 | ||
143 | 3 paths listed.</programlisting> | |
144 | </para> | |
145 | ||
146 | <para>Also see <option>--show-types</option>, <option>--all</option>, and <option>--state=</option>.</para> | |
147 | </listitem> | |
148 | </varlistentry> | |
149 | ||
e1fac8a6 ZJS |
150 | <varlistentry> |
151 | <term><command>list-sockets</command> <optional><replaceable>PATTERN</replaceable>…</optional></term> | |
ea539eb6 | 152 | |
e1fac8a6 ZJS |
153 | <listitem> |
154 | <para>List socket units currently in memory, ordered by listening address. If one or more | |
155 | <replaceable>PATTERN</replaceable>s are specified, only socket units matching one of them are | |
156 | shown. Produces output similar to | |
157 | <programlisting> | |
158 | LISTEN UNIT ACTIVATES | |
159 | /dev/initctl systemd-initctl.socket systemd-initctl.service | |
160 | … | |
161 | [::]:22 sshd.socket sshd.service | |
162 | kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service | |
4a6022f0 | 163 | |
e1fac8a6 ZJS |
164 | 5 sockets listed.</programlisting> |
165 | Note: because the addresses might contains spaces, this output | |
166 | is not suitable for programmatic consumption. | |
167 | </para> | |
4a6022f0 | 168 | |
e1fac8a6 ZJS |
169 | <para>Also see <option>--show-types</option>, <option>--all</option>, and <option>--state=</option>.</para> |
170 | </listitem> | |
171 | </varlistentry> | |
21b587cf | 172 | |
e1fac8a6 ZJS |
173 | <varlistentry> |
174 | <term><command>list-timers</command> <optional><replaceable>PATTERN</replaceable>…</optional></term> | |
e9fbae3f | 175 | |
e1fac8a6 ZJS |
176 | <listitem> |
177 | <para>List timer units currently in memory, ordered by the time they elapse next. If one or more | |
178 | <replaceable>PATTERN</replaceable>s are specified, only units matching one of them are shown. | |
179 | Produces output similar to | |
180 | <programlisting> | |
181 | NEXT LEFT LAST PASSED UNIT ACTIVATES | |
8a965108 | 182 | - - Thu 2017-02-23 13:40:29 EST 3 days ago ureadahead-stop.timer ureadahead-stop.service |
e1fac8a6 ZJS |
183 | 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 |
184 | 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 | |
185 | 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 | |
186 | </programlisting> | |
187 | </para> | |
4fa226ff | 188 | |
e1fac8a6 ZJS |
189 | <para><emphasis>NEXT</emphasis> shows the next time the timer will run.</para> |
190 | <para><emphasis>LEFT</emphasis> shows how long till the next time the timer runs.</para> | |
191 | <para><emphasis>LAST</emphasis> shows the last time the timer ran.</para> | |
192 | <para><emphasis>PASSED</emphasis> shows how long has passed since the timer last ran.</para> | |
193 | <para><emphasis>UNIT</emphasis> shows the name of the timer</para> | |
194 | <para><emphasis>ACTIVATES</emphasis> shows the name the service the timer activates when it runs.</para> | |
4a6022f0 | 195 | |
e1fac8a6 ZJS |
196 | <para>Also see <option>--all</option> and <option>--state=</option>.</para> |
197 | </listitem> | |
198 | </varlistentry> | |
1238ee09 | 199 | |
172338d5 ZJS |
200 | <varlistentry> |
201 | <term><command>is-active <replaceable>PATTERN</replaceable>…</command></term> | |
202 | ||
203 | <listitem> | |
204 | <para>Check whether any of the specified units are active | |
205 | (i.e. running). Returns an exit code | |
206 | <constant>0</constant> if at least one is active, or | |
207 | non-zero otherwise. Unless <option>--quiet</option> is | |
208 | specified, this will also print the current unit state to | |
209 | standard output.</para> | |
210 | </listitem> | |
211 | </varlistentry> | |
212 | ||
213 | <varlistentry> | |
214 | <term><command>is-failed <replaceable>PATTERN</replaceable>…</command></term> | |
215 | ||
216 | <listitem> | |
217 | <para>Check whether any of the specified units are in a | |
218 | "failed" state. Returns an exit code | |
219 | <constant>0</constant> if at least one has failed, | |
220 | non-zero otherwise. Unless <option>--quiet</option> is | |
221 | specified, this will also print the current unit state to | |
222 | standard output.</para> | |
223 | </listitem> | |
224 | </varlistentry> | |
225 | ||
226 | <varlistentry> | |
227 | <term><command>status</command> <optional><replaceable>PATTERN</replaceable>…|<replaceable>PID</replaceable>…]</optional></term> | |
228 | ||
229 | <listitem> | |
a6e33464 ZJS |
230 | <para>Show runtime status information about the whole system or about one or more units followed |
231 | by most recent log data from the journal. If no positional arguments are specified, and no unit | |
232 | filter is given with <option>--type=</option>, <option>--state=</option>, or | |
233 | <option>--failed</option>, shows the status of the whole system. If combined with | |
234 | <option>--all</option>, follows that with the status of all units. If positional arguments are | |
235 | specified, each positional argument is treated as either a unit name to show, or a glob pattern | |
236 | to show units whose names match that pattern, or a PID to show the unit containing that PID. When | |
237 | <option>--type=</option>, <option>--state=</option>, or <option>--failed</option> are used, units | |
238 | are additionally filtered by the TYPE and ACTIVE state.</para> | |
172338d5 | 239 | |
157cb433 LP |
240 | <para>This function is intended to generate human-readable output. If you are looking for |
241 | computer-parsable output, use <command>show</command> instead. By default, this function only | |
242 | shows 10 lines of output and ellipsizes lines to fit in the terminal window. This can be changed | |
243 | with <option>--lines</option> and <option>--full</option>, see above. In addition, | |
244 | <command>journalctl --unit=<replaceable>NAME</replaceable></command> or <command>journalctl | |
245 | --user-unit=<replaceable>NAME</replaceable></command> use a similar filter for messages and might | |
246 | be more convenient.</para> | |
247 | ||
1374f5a0 | 248 | <para>Note that this operation only displays <emphasis>runtime</emphasis> status, i.e. information about |
157cb433 LP |
249 | the current invocation of the unit (if it is running) or the most recent invocation (if it is not |
250 | running anymore, and has not been released from memory). Information about earlier invocations, | |
251 | invocations from previous system boots, or prior invocations that have already been released from | |
252 | memory may be retrieved via <command>journalctl --unit=</command>.</para> | |
253 | ||
254 | <para>systemd implicitly loads units as necessary, so just running the <command>status</command> | |
255 | will attempt to load a file. The command is thus not useful for determining if something was | |
256 | already loaded or not. The units may possibly also be quickly unloaded after the operation is | |
257 | completed if there's no reason to keep it in memory thereafter.</para> | |
172338d5 ZJS |
258 | |
259 | <example> | |
260 | <title>Example output from systemctl status </title> | |
261 | ||
262 | <programlisting>$ systemctl status bluetooth | |
263 | ● bluetooth.service - Bluetooth service | |
c1e0dc9c | 264 | Loaded: loaded (/usr/lib/systemd/system/bluetooth.service; enabled; preset: enabled) |
172338d5 ZJS |
265 | Active: active (running) since Wed 2017-01-04 13:54:04 EST; 1 weeks 0 days ago |
266 | Docs: man:bluetoothd(8) | |
267 | Main PID: 930 (bluetoothd) | |
268 | Status: "Running" | |
269 | Tasks: 1 | |
270 | Memory: 648.0K | |
271 | CPU: 435ms | |
272 | CGroup: /system.slice/bluetooth.service | |
273 | └─930 /usr/lib/bluetooth/bluetoothd | |
274 | ||
275 | Jan 12 10:46:45 example.com bluetoothd[8900]: Not enough free handles to register service | |
276 | Jan 12 10:46:45 example.com bluetoothd[8900]: Current Time Service could not be registered | |
277 | Jan 12 10:46:45 example.com bluetoothd[8900]: gatt-time-server: Input/output error (5) | |
278 | </programlisting> | |
279 | ||
0c772b1c LP |
280 | <para>The dot ("●") uses color on supported terminals to summarize the unit state at a |
281 | glance. Along with its color, its shape varies according to its state: | |
282 | <literal>inactive</literal> or <literal>maintenance</literal> is a white circle ("○"), | |
283 | <literal>active</literal> is a green dot ("●"), <literal>deactivating</literal> is a white dot, | |
284 | <literal>failed</literal> or <literal>error</literal> is a red cross ("×"), and | |
285 | <literal>reloading</literal> is a green clockwise circle arrow ("↻").</para> | |
286 | ||
287 | <para>The "Loaded:" line in the output will show <literal>loaded</literal> if the unit has been | |
288 | loaded into memory. Other possible values for "Loaded:" include: <literal>error</literal> if | |
289 | there was a problem loading it, <literal>not-found</literal> if no unit file was found for this | |
290 | unit, <literal>bad-setting</literal> if an essential unit file setting could not be parsed and | |
291 | <literal>masked</literal> if the unit file has been masked. Along with showing the path to the | |
292 | unit file, this line will also show the enablement state. Enabled units are included in the | |
293 | dependency network between units, and thus are started at boot or via some other form of | |
294 | activation. See the full table of possible enablement states — including the definition of | |
295 | <literal>masked</literal> — in the documentation for the <command>is-enabled</command> command. | |
172338d5 ZJS |
296 | </para> |
297 | ||
298 | <para>The "Active:" line shows active state. The value is usually <literal>active</literal> or | |
0c772b1c LP |
299 | <literal>inactive</literal>. Active could mean started, bound, plugged in, etc depending on the |
300 | unit type. The unit could also be in process of changing states, reporting a state of | |
301 | <literal>activating</literal> or <literal>deactivating</literal>. A special | |
302 | <literal>failed</literal> state is entered when the service failed in some way, such as a crash, | |
303 | exiting with an error code or timing out. If the failed state is entered the cause will be logged | |
304 | for later reference.</para> | |
172338d5 ZJS |
305 | </example> |
306 | ||
307 | </listitem> | |
308 | </varlistentry> | |
309 | ||
310 | <varlistentry> | |
311 | <term><command>show</command> <optional><replaceable>PATTERN</replaceable>…|<replaceable>JOB</replaceable>…</optional></term> | |
312 | ||
313 | <listitem> | |
314 | <para>Show properties of one or more units, jobs, or the manager itself. If no argument is specified, | |
315 | properties of the manager will be shown. If a unit name is specified, properties of the unit are shown, and | |
316 | if a job ID is specified, properties of the job are shown. By default, empty properties are suppressed. Use | |
317 | <option>--all</option> to show those too. To select specific properties to show, use | |
318 | <option>--property=</option>. This command is intended to be used whenever computer-parsable output is | |
319 | required. Use <command>status</command> if you are looking for formatted human-readable output.</para> | |
320 | ||
321 | <para>Many properties shown by <command>systemctl show</command> map directly to configuration settings of | |
322 | the system and service manager and its unit files. Note that the properties shown by the command are | |
323 | generally more low-level, normalized versions of the original configuration settings and expose runtime | |
324 | state in addition to configuration. For example, properties shown for service units include the service's | |
325 | current main process identifier as <literal>MainPID</literal> (which is runtime state), and time settings | |
326 | are always exposed as properties ending in the <literal>…USec</literal> suffix even if a matching | |
327 | configuration options end in <literal>…Sec</literal>, because microseconds is the normalized time unit used | |
328 | internally by the system and service manager.</para> | |
329 | ||
330 | <para>For details about many of these properties, see the documentation of the D-Bus interface | |
331 | backing these properties, see | |
332 | <citerefentry><refentrytitle>org.freedesktop.systemd1</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para> | |
333 | </listitem> | |
334 | </varlistentry> | |
335 | ||
336 | <varlistentry> | |
337 | <term><command>cat <replaceable>PATTERN</replaceable>…</command></term> | |
338 | ||
339 | <listitem> | |
340 | <para>Show backing files of one or more units. Prints the | |
341 | "fragment" and "drop-ins" (source files) of units. Each | |
342 | file is preceded by a comment which includes the file | |
343 | name. Note that this shows the contents of the backing files | |
344 | on disk, which may not match the system manager's | |
345 | understanding of these units if any unit files were | |
346 | updated on disk and the <command>daemon-reload</command> | |
347 | command wasn't issued since.</para> | |
348 | </listitem> | |
349 | </varlistentry> | |
350 | ||
351 | <varlistentry> | |
352 | <term><command>help <replaceable>PATTERN</replaceable>…|<replaceable>PID</replaceable>…</command></term> | |
353 | ||
354 | <listitem> | |
355 | <para>Show manual pages for one or more units, if | |
356 | available. If a PID is given, the manual pages for the unit | |
357 | the process belongs to are shown.</para> | |
358 | </listitem> | |
359 | </varlistentry> | |
360 | ||
361 | <varlistentry> | |
362 | <term> | |
363 | <command>list-dependencies</command> | |
364 | <optional><replaceable>UNIT</replaceable>...</optional> | |
365 | </term> | |
366 | ||
367 | <listitem> | |
368 | <para>Shows units required and wanted by the specified | |
369 | units. This recursively lists units following the | |
38f90179 MY |
370 | <varname>Requires=</varname>, <varname>Requisite=</varname>, |
371 | <varname>Wants=</varname>, <varname>ConsistsOf=</varname>, | |
372 | <varname>BindsTo=</varname>, and <varname>Upholds=</varname> | |
172338d5 ZJS |
373 | dependencies. If no units are specified, |
374 | <filename>default.target</filename> is implied.</para> | |
375 | ||
37299769 MY |
376 | <para>The units that are shown are additionally filtered by <option>--type=</option> and |
377 | <option>--state=</option> if those options are specified. Note that we won't be able to | |
378 | use a tree structure in this case, so <option>--plain</option> is implied.</para> | |
379 | ||
172338d5 ZJS |
380 | <para>By default, only target units are recursively |
381 | expanded. When <option>--all</option> is passed, all other | |
382 | units are recursively expanded as well.</para> | |
383 | ||
384 | <para>Options <option>--reverse</option>, | |
385 | <option>--after</option>, <option>--before</option> | |
386 | may be used to change what types of dependencies | |
387 | are shown.</para> | |
388 | ||
389 | <para>Note that this command only lists units currently loaded into memory by the service manager. In | |
390 | particular, this command is not suitable to get a comprehensive list at all reverse dependencies on a | |
391 | specific unit, as it won't list the dependencies declared by units currently not loaded.</para> | |
392 | </listitem> | |
393 | </varlistentry> | |
394 | ||
395 | <!-- Commands that modify unit state start here --> | |
396 | ||
e1fac8a6 ZJS |
397 | <varlistentry> |
398 | <term><command>start <replaceable>PATTERN</replaceable>…</command></term> | |
1238ee09 | 399 | |
e1fac8a6 | 400 | <listitem> |
1d56bc09 ZJS |
401 | <para>Start (activate) one or more units specified on the command line.</para> |
402 | ||
403 | <para>Note that unit glob patterns expand to names of units currently in memory. Units which are | |
404 | not active and are not in a failed state usually are not in memory, and will not be matched by | |
405 | any pattern. In addition, in case of instantiated units, systemd is often unaware of the instance | |
406 | name until the instance has been started. Therefore, using glob patterns with | |
407 | <command>start</command> has limited usefulness. Also, secondary alias names of units are not | |
408 | considered.</para> | |
409 | ||
410 | <para>Option <option>--all</option> may be used to also operate on inactive units which are | |
411 | referenced by other loaded units. Note that this is not the same as operating on "all" possible | |
412 | units, because as the previous paragraph describes, such a list is ill-defined. Nevertheless, | |
413 | <command>systemctl start --all <replaceable>GLOB</replaceable></command> may be useful if all the | |
414 | units that should match the pattern are pulled in by some target which is known to be loaded. | |
415 | </para> | |
e1fac8a6 ZJS |
416 | </listitem> |
417 | </varlistentry> | |
418 | <varlistentry> | |
419 | <term><command>stop <replaceable>PATTERN</replaceable>…</command></term> | |
afba4199 | 420 | |
e1fac8a6 ZJS |
421 | <listitem> |
422 | <para>Stop (deactivate) one or more units specified on the command line.</para> | |
9029f642 | 423 | |
e1fac8a6 ZJS |
424 | <para>This command will fail if the unit does not exist or if stopping of the unit is prohibited (see |
425 | <varname>RefuseManualStop=</varname> in | |
426 | <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>). | |
427 | It will <emphasis>not</emphasis> fail if any of the commands configured to stop the unit | |
428 | (<varname>ExecStop=</varname>, etc.) fail, because the manager will still forcibly terminate the | |
429 | unit.</para> | |
430 | </listitem> | |
431 | </varlistentry> | |
432 | <varlistentry> | |
433 | <term><command>reload <replaceable>PATTERN</replaceable>…</command></term> | |
f6375e83 | 434 | |
e1fac8a6 ZJS |
435 | <listitem> |
436 | <para>Asks all units listed on the command line to reload | |
437 | their configuration. Note that this will reload the | |
438 | service-specific configuration, not the unit configuration | |
439 | file of systemd. If you want systemd to reload the | |
440 | configuration file of a unit, use the | |
441 | <command>daemon-reload</command> command. In other words: | |
442 | for the example case of Apache, this will reload Apache's | |
443 | <filename>httpd.conf</filename> in the web server, not the | |
444 | <filename>apache.service</filename> systemd unit | |
445 | file.</para> | |
82948f6c | 446 | |
e1fac8a6 ZJS |
447 | <para>This command should not be confused with the |
448 | <command>daemon-reload</command> command.</para> | |
449 | </listitem> | |
9029f642 | 450 | |
e1fac8a6 ZJS |
451 | </varlistentry> |
452 | <varlistentry> | |
453 | <term><command>restart <replaceable>PATTERN</replaceable>…</command></term> | |
afba4199 | 454 | |
e1fac8a6 ZJS |
455 | <listitem> |
456 | <para>Stop and then start one or more units specified on the command line. If the units are not running | |
457 | yet, they will be started.</para> | |
afba4199 | 458 | |
e1fac8a6 ZJS |
459 | <para>Note that restarting a unit with this command does not necessarily flush out all of the unit's |
460 | resources before it is started again. For example, the per-service file descriptor storage facility (see | |
461 | <varname>FileDescriptorStoreMax=</varname> in | |
462 | <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>) will | |
463 | remain intact as long as the unit has a job pending, and is only cleared when the unit is fully stopped and | |
464 | no jobs are pending anymore. If it is intended that the file descriptor store is flushed out, too, during a | |
465 | restart operation an explicit <command>systemctl stop</command> command followed by <command>systemctl | |
466 | start</command> should be issued.</para> | |
467 | </listitem> | |
468 | </varlistentry> | |
469 | <varlistentry> | |
470 | <term><command>try-restart <replaceable>PATTERN</replaceable>…</command></term> | |
4a6022f0 | 471 | |
e1fac8a6 ZJS |
472 | <listitem> |
473 | <para>Stop and then start one or more units specified on the | |
474 | command line if the units are running. This does nothing | |
475 | if units are not running.</para> | |
476 | <!-- Note that we don't document condrestart here, as that is just compatibility support, and we generally | |
477 | don't document that. --> | |
478 | </listitem> | |
479 | </varlistentry> | |
480 | <varlistentry> | |
481 | <term><command>reload-or-restart <replaceable>PATTERN</replaceable>…</command></term> | |
4a6022f0 | 482 | |
e1fac8a6 ZJS |
483 | <listitem> |
484 | <para>Reload one or more units if they support it. If not, stop and then start them instead. If the units | |
485 | are not running yet, they will be started.</para> | |
486 | </listitem> | |
487 | </varlistentry> | |
488 | <varlistentry> | |
489 | <term><command>try-reload-or-restart <replaceable>PATTERN</replaceable>…</command></term> | |
4f9a9105 | 490 | |
e1fac8a6 ZJS |
491 | <listitem> |
492 | <para>Reload one or more units if they support it. If not, stop and then start them instead. This does | |
493 | nothing if the units are not running.</para> | |
494 | <!-- Note that we don't document force-reload here, as that is just compatibility support, and we generally | |
495 | don't document that. --> | |
496 | </listitem> | |
497 | </varlistentry> | |
498 | <varlistentry> | |
499 | <term><command>isolate <replaceable>UNIT</replaceable></command></term> | |
4f9a9105 | 500 | |
e1fac8a6 ZJS |
501 | <listitem> |
502 | <para>Start the unit specified on the command line and its dependencies | |
503 | and stop all others, unless they have | |
504 | <option>IgnoreOnIsolate=yes</option> (see | |
505 | <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>). | |
506 | If a unit name with no extension is given, an extension of | |
507 | <literal>.target</literal> will be assumed.</para> | |
991f2a39 | 508 | |
5cf821ac ZJS |
509 | <para>This command is dangerous, since it will immediately stop processes that are not enabled in |
510 | the new target, possibly including the graphical environment or terminal you are currently using. | |
511 | </para> | |
991f2a39 | 512 | |
483bf564 | 513 | <para>Note that this operation is allowed only on units where |
e1fac8a6 ZJS |
514 | <option>AllowIsolate=</option> is enabled. See |
515 | <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry> | |
516 | for details.</para> | |
517 | </listitem> | |
518 | </varlistentry> | |
519 | <varlistentry> | |
520 | <term><command>kill <replaceable>PATTERN</replaceable>…</command></term> | |
23ade460 | 521 | |
e1fac8a6 | 522 | <listitem> |
f4ff3e71 LP |
523 | <para>Send a UNIX process signal to one or more processes of the unit. Use |
524 | <option>--kill-whom=</option> to select which process to send the signal to. Use | |
525 | <option>--signal=</option> to select the signal to send. Combine with | |
526 | <option>--kill-value=</option> to enqueue a POSIX Realtime Signal with an associated | |
527 | value.</para> | |
e1fac8a6 ZJS |
528 | </listitem> |
529 | </varlistentry> | |
530 | <varlistentry> | |
531 | <term><command>clean <replaceable>PATTERN</replaceable>…</command></term> | |
4dc5b821 | 532 | |
e1fac8a6 ZJS |
533 | <listitem> |
534 | <para>Remove the configuration, state, cache, logs or runtime data of the specified units. Use | |
535 | <option>--what=</option> to select which kind of resource to remove. For service units this may | |
536 | be used to remove the directories configured with <varname>ConfigurationDirectory=</varname>, | |
537 | <varname>StateDirectory=</varname>, <varname>CacheDirectory=</varname>, | |
538 | <varname>LogsDirectory=</varname> and <varname>RuntimeDirectory=</varname>, see | |
539 | <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry> | |
94d82b59 | 540 | for details. It may also be used to clear the file descriptor store as enabled via |
4fb8f1e8 LP |
541 | <varname>FileDescriptorStoreMax=</varname>, see |
542 | <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry> | |
543 | for details. For timer units this may be used to clear out the persistent timestamp data if | |
e1fac8a6 ZJS |
544 | <varname>Persistent=</varname> is used and <option>--what=state</option> is selected, see |
545 | <citerefentry><refentrytitle>systemd.timer</refentrytitle><manvolnum>5</manvolnum></citerefentry>. This | |
546 | command only applies to units that use either of these settings. If <option>--what=</option> is | |
4fb8f1e8 LP |
547 | not specified, the cache and runtime data as well as the file descriptor store are removed (as |
548 | these three types of resources are generally redundant and reproducible on the next invocation of | |
549 | the unit). Note that the specified units must be stopped to invoke this operation.</para> | |
e1fac8a6 ZJS |
550 | </listitem> |
551 | </varlistentry> | |
d9e45bc3 MS |
552 | <varlistentry> |
553 | <term><command>freeze <replaceable>PATTERN</replaceable>…</command></term> | |
554 | ||
555 | <listitem> | |
556 | <para>Freeze one or more units specified on the | |
557 | command line using cgroup freezer</para> | |
558 | ||
559 | <para>Freezing the unit will cause all processes contained within the cgroup corresponding to the unit | |
560 | to be suspended. Being suspended means that unit's processes won't be scheduled to run on CPU until thawed. | |
561 | Note that this command is supported only on systems that use unified cgroup hierarchy. Unit is automatically | |
562 | thawed just before we execute a job against the unit, e.g. before the unit is stopped.</para> | |
563 | </listitem> | |
564 | </varlistentry> | |
565 | <varlistentry> | |
566 | <term><command>thaw <replaceable>PATTERN</replaceable>…</command></term> | |
567 | ||
568 | <listitem> | |
569 | <para>Thaw (unfreeze) one or more units specified on the | |
570 | command line.</para> | |
571 | ||
572 | <para>This is the inverse operation to the <command>freeze</command> command and resumes the execution of | |
573 | processes in the unit's cgroup.</para> | |
574 | </listitem> | |
575 | </varlistentry> | |
e1fac8a6 ZJS |
576 | <varlistentry> |
577 | <term><command>set-property <replaceable>UNIT</replaceable> <replaceable>PROPERTY</replaceable>=<replaceable>VALUE</replaceable>…</command></term> | |
1ae17672 | 578 | |
e1fac8a6 ZJS |
579 | <listitem> |
580 | <para>Set the specified unit properties at runtime where | |
581 | this is supported. This allows changing configuration | |
582 | parameter properties such as resource control settings at | |
583 | runtime. Not all properties may be changed at runtime, but | |
584 | many resource control settings (primarily those in | |
585 | <citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>) | |
586 | may. The changes are applied immediately, and stored on disk | |
587 | for future boots, unless <option>--runtime</option> is | |
588 | passed, in which case the settings only apply until the | |
589 | next reboot. The syntax of the property assignment follows | |
590 | closely the syntax of assignments in unit files.</para> | |
4a6022f0 | 591 | |
e1fac8a6 | 592 | <para>Example: <command>systemctl set-property foobar.service CPUWeight=200</command></para> |
4a6022f0 | 593 | |
e1fac8a6 ZJS |
594 | <para>If the specified unit appears to be inactive, the |
595 | changes will be only stored on disk as described | |
596 | previously hence they will be effective when the unit will | |
597 | be started.</para> | |
4a6022f0 | 598 | |
e1fac8a6 ZJS |
599 | <para>Note that this command allows changing multiple properties at the same time, which is |
600 | preferable over setting them individually.</para> | |
93a08841 | 601 | |
e1fac8a6 | 602 | <para>Example: <command>systemctl set-property foobar.service CPUWeight=200 MemoryMax=2G IPAccounting=yes</command></para> |
93a08841 | 603 | |
e1fac8a6 ZJS |
604 | <para>Like with unit file configuration settings, assigning an empty setting usually resets a |
605 | property to its defaults.</para> | |
adb6cd9b | 606 | |
e1fac8a6 ZJS |
607 | <para>Example: <command>systemctl set-property avahi-daemon.service IPAddressDeny=</command></para> |
608 | </listitem> | |
609 | </varlistentry> | |
4a6022f0 | 610 | |
5e8deb94 | 611 | <varlistentry> |
e04eae5e ZJS |
612 | <term> |
613 | <command>bind</command> | |
614 | <replaceable>UNIT</replaceable> | |
615 | <replaceable>PATH</replaceable> | |
616 | [<replaceable>PATH</replaceable>] | |
617 | </term> | |
618 | ||
619 | <listitem><para>Bind-mounts a file or directory from the host into the specified unit's mount | |
620 | namespace. The first path argument is the source file or directory on the host, the second path | |
621 | argument is the destination file or directory in the unit's mount namespace. When the latter is | |
622 | omitted, the destination path in the unit's mount namespace is the same as the source path on the | |
623 | host. When combined with the <option>--read-only</option> switch, a ready-only bind mount is | |
624 | created. When combined with the <option>--mkdir</option> switch, the destination path is first | |
625 | created before the mount is applied.</para> | |
626 | ||
627 | <para>Note that this option is currently only supported for units that run within a mount namespace | |
628 | (e.g.: with <option>RootImage=</option>, <option>PrivateMounts=</option>, etc.). This command | |
629 | supports bind-mounting directories, regular files, device nodes, <constant>AF_UNIX</constant> | |
630 | socket nodes, as well as FIFOs. The bind mount is ephemeral, and it is undone as soon as the | |
631 | current unit process exists. Note that the namespace mentioned here, where the bind mount will be | |
632 | added to, is the one where the main service process runs. Other processes (those exececuted by | |
633 | <option>ExecReload=</option>, <option>ExecStartPre=</option>, etc.) run in distinct namespaces. | |
634 | </para></listitem> | |
635 | </varlistentry> | |
636 | ||
637 | <varlistentry> | |
638 | <term> | |
639 | <command>mount-image</command> | |
640 | <replaceable>UNIT</replaceable> | |
641 | <replaceable>IMAGE</replaceable> | |
642 | [<replaceable>PATH</replaceable> | |
643 | [<replaceable>PARTITION_NAME</replaceable>:<replaceable>MOUNT_OPTIONS</replaceable>]] | |
644 | </term> | |
645 | ||
646 | <listitem><para>Mounts an image from the host into the specified unit's mount namespace. The first | |
647 | path argument is the source image on the host, the second path argument is the destination | |
648 | directory in the unit's mount namespace (i.e. inside | |
649 | <option>RootImage=</option>/<option>RootDirectory=</option>). The following argument, if any, is | |
650 | interpreted as a colon-separated tuple of partition name and comma-separated list of mount options | |
651 | for that partition. The format is the same as the service <option>MountImages=</option> | |
652 | setting. When combined with the <option>--read-only</option> switch, a ready-only mount is | |
653 | created. When combined with the <option>--mkdir</option> switch, the destination path is first | |
654 | created before the mount is applied.</para> | |
655 | ||
656 | <para>Note that this option is currently only supported for units that run within a mount namespace | |
657 | (i.e. with <option>RootImage=</option>, <option>PrivateMounts=</option>, etc.). Note that the | |
658 | namespace mentioned here where the image mount will be added to, is the one where the main service | |
659 | process runs. Note that the namespace mentioned here, where the bind mount will be | |
660 | added to, is the one where the main service process runs. Other processes (those exececuted by | |
661 | <option>ExecReload=</option>, <option>ExecStartPre=</option>, etc.) run in distinct namespaces. | |
662 | </para> | |
663 | ||
664 | <para>Example: | |
6faecbd3 | 665 | <programlisting>systemctl mount-image foo.service /tmp/img.raw /var/lib/image root:ro,nosuid</programlisting> |
e04eae5e ZJS |
666 | <programlisting>systemctl mount-image --mkdir bar.service /tmp/img.raw /var/lib/baz/img</programlisting> |
667 | </para></listitem> | |
6faecbd3 LB |
668 | </varlistentry> |
669 | ||
6824c132 ZJS |
670 | <varlistentry> |
671 | <term><command>service-log-level</command> <replaceable>SERVICE</replaceable> [<replaceable>LEVEL</replaceable>]</term> | |
672 | ||
673 | <listitem><para>If the <replaceable>LEVEL</replaceable> argument is not given, print the current | |
674 | log level as reported by service <replaceable>SERVICE</replaceable>.</para> | |
675 | ||
676 | <para>If the optional argument <replaceable>LEVEL</replaceable> is provided, then change the | |
677 | current log level of the service to <replaceable>LEVEL</replaceable>. The log level should be a | |
678 | typical syslog log level, i.e. a value in the range 0…7 or one of the strings | |
679 | <constant>emerg</constant>, <constant>alert</constant>, <constant>crit</constant>, | |
680 | <constant>err</constant>, <constant>warning</constant>, <constant>notice</constant>, | |
681 | <constant>info</constant>, <constant>debug</constant>; see <citerefentry | |
682 | project='man-pages'><refentrytitle>syslog</refentrytitle><manvolnum>3</manvolnum></citerefentry> | |
683 | for details.</para> | |
684 | ||
685 | <para>The service must have the appropriate | |
686 | <varname>BusName=<replaceable>destination</replaceable></varname> property and also implement the | |
687 | generic | |
688 | <citerefentry><refentrytitle>org.freedesktop.LogControl1</refentrytitle><manvolnum>5</manvolnum></citerefentry> | |
689 | interface. (<filename>systemctl</filename> will use the generic D-Bus protocol to access the | |
690 | <interfacename>org.freedesktop.LogControl1.LogLevel</interfacename> interface for the D-Bus name | |
691 | <replaceable>destination</replaceable>.)</para></listitem> | |
692 | </varlistentry> | |
693 | ||
694 | <varlistentry> | |
695 | <term><command>service-log-target</command> <replaceable>SERVICE</replaceable> [<replaceable>TARGET</replaceable>]</term> | |
696 | ||
697 | <listitem><para>If the <replaceable>TARGET</replaceable> argument is not given, print the current | |
698 | log target as reported by service <replaceable>SERVICE</replaceable>.</para> | |
699 | ||
700 | <para>If the optional argument <replaceable>TARGET</replaceable> is provided, then change the | |
701 | current log target of the service to <replaceable>TARGET</replaceable>. The log target should be | |
702 | one of the strings <constant>console</constant> (for log output to the service's standard error | |
703 | stream), <constant>kmsg</constant> (for log output to the kernel log buffer), | |
704 | <constant>journal</constant> (for log output to | |
705 | <citerefentry><refentrytitle>systemd-journald.service</refentrytitle><manvolnum>8</manvolnum></citerefentry> | |
706 | using the native journal protocol), <constant>syslog</constant> (for log output to the classic | |
707 | syslog socket <filename>/dev/log</filename>), <constant>null</constant> (for no log output | |
708 | whatsoever) or <constant>auto</constant> (for an automatically determined choice, typically | |
709 | equivalent to <constant>console</constant> if the service is invoked interactively, and | |
710 | <constant>journal</constant> or <constant>syslog</constant> otherwise).</para> | |
711 | ||
712 | <para>For most services, only a small subset of log targets make sense. In particular, most | |
713 | "normal" services should only implement <constant>console</constant>, <constant>journal</constant>, | |
714 | and <constant>null</constant>. Anything else is only appropriate for low-level services that | |
715 | are active in very early boot before proper logging is established.</para> | |
716 | ||
717 | <para>The service must have the appropriate | |
718 | <varname>BusName=<replaceable>destination</replaceable></varname> property and also implement the | |
719 | generic | |
720 | <citerefentry><refentrytitle>org.freedesktop.LogControl1</refentrytitle><manvolnum>5</manvolnum></citerefentry> | |
721 | interface. (<filename>systemctl</filename> will use the generic D-Bus protocol to access the | |
722 | <interfacename>org.freedesktop.LogControl1.LogLevel</interfacename> interface for the D-Bus name | |
723 | <replaceable>destination</replaceable>.)</para></listitem> | |
724 | </varlistentry> | |
725 | ||
e1fac8a6 ZJS |
726 | <varlistentry> |
727 | <term><command>reset-failed [<replaceable>PATTERN</replaceable>…]</command></term> | |
599b6322 | 728 | |
e1fac8a6 ZJS |
729 | <listitem> |
730 | <para>Reset the <literal>failed</literal> state of the specified units, or if no unit name is passed, reset | |
731 | the state of all units. When a unit fails in some way (i.e. process exiting with non-zero error code, | |
732 | terminating abnormally or timing out), it will automatically enter the <literal>failed</literal> state and | |
733 | its exit code and status is recorded for introspection by the administrator until the service is | |
734 | stopped/re-started or reset with this command.</para> | |
4a6022f0 | 735 | |
e1fac8a6 ZJS |
736 | <para>In addition to resetting the <literal>failed</literal> state of a unit it also resets various other |
737 | per-unit properties: the start rate limit counter of all unit types is reset to zero, as is the restart | |
738 | counter of service units. Thus, if a unit's start limit (as configured with | |
739 | <varname>StartLimitIntervalSec=</varname>/<varname>StartLimitBurst=</varname>) is hit and the unit refuses | |
740 | to be started again, use this command to make it startable again.</para> | |
741 | </listitem> | |
742 | </varlistentry> | |
e1fac8a6 ZJS |
743 | </variablelist> |
744 | </refsect2> | |
4a6022f0 | 745 | |
e1fac8a6 ZJS |
746 | <refsect2> |
747 | <title>Unit File Commands</title> | |
4a6022f0 | 748 | |
e1fac8a6 ZJS |
749 | <variablelist> |
750 | <varlistentry> | |
751 | <term><command>list-unit-files</command> <optional><replaceable>PATTERN…</replaceable></optional></term> | |
4a6022f0 | 752 | |
e1fac8a6 | 753 | <listitem> |
7ea5e82f LP |
754 | <para>List unit files installed on the system, in combination with their enablement state (as |
755 | reported by <command>is-enabled</command>). If one or more <replaceable>PATTERN</replaceable>s | |
756 | are specified, only unit files whose name matches one of them are shown (patterns matching unit | |
757 | file system paths are not supported).</para> | |
758 | ||
759 | <para>Unlike <command>list-units</command> this command will list template units in addition to | |
760 | explicitly instantiated units.</para> | |
e1fac8a6 ZJS |
761 | </listitem> |
762 | </varlistentry> | |
4a6022f0 | 763 | |
e1fac8a6 ZJS |
764 | <varlistentry> |
765 | <term><command>enable <replaceable>UNIT</replaceable>…</command></term> | |
766 | <term><command>enable <replaceable>PATH</replaceable>…</command></term> | |
4a6022f0 | 767 | |
e1fac8a6 ZJS |
768 | <listitem> |
769 | <para>Enable one or more units or unit instances. This will create a set of symlinks, as encoded in the | |
bdac5608 | 770 | [Install] sections of the indicated unit files. After the symlinks have been created, |
e1fac8a6 ZJS |
771 | the system manager configuration is reloaded (in a way equivalent to <command>daemon-reload</command>), in |
772 | order to ensure the changes are taken into account immediately. Note that this does | |
773 | <emphasis>not</emphasis> have the effect of also starting any of the units being enabled. If this is | |
774 | desired, combine this command with the <option>--now</option> switch, or invoke <command>start</command> | |
775 | with appropriate arguments later. Note that in case of unit instance enablement (i.e. enablement of units of | |
776 | the form <filename>foo@bar.service</filename>), symlinks named the same as instances are created in the | |
777 | unit configuration directory, however they point to the single template unit file they are instantiated | |
778 | from.</para> | |
4a6022f0 | 779 | |
e1fac8a6 ZJS |
780 | <para>This command expects either valid unit names (in which case various unit file directories are |
781 | automatically searched for unit files with appropriate names), or absolute paths to unit files (in which | |
782 | case these files are read directly). If a specified unit file is located outside of the usual unit file | |
783 | directories, an additional symlink is created, linking it into the unit configuration path, thus ensuring | |
784 | it is found when requested by commands such as <command>start</command>. The file system where the linked | |
785 | unit files are located must be accessible when systemd is started (e.g. anything underneath | |
3b121157 | 786 | <filename>/home/</filename> or <filename>/var/</filename> is not allowed, unless those directories are |
e1fac8a6 | 787 | located on the root file system).</para> |
4a6022f0 | 788 | |
e1fac8a6 ZJS |
789 | <para>This command will print the file system operations executed. This output may be suppressed by passing |
790 | <option>--quiet</option>. | |
791 | </para> | |
8c8208cb | 792 | |
bdac5608 | 793 | <para>Note that this operation creates only the symlinks suggested in the [Install] |
e1fac8a6 ZJS |
794 | section of the unit files. While this command is the recommended way to manipulate the unit configuration |
795 | directory, the administrator is free to make additional changes manually by placing or removing symlinks | |
796 | below this directory. This is particularly useful to create configurations that deviate from the suggested | |
797 | default installation. In this case, the administrator must make sure to invoke | |
798 | <command>daemon-reload</command> manually as necessary, in order to ensure the changes are taken into | |
799 | account. | |
800 | </para> | |
8c8208cb | 801 | |
108d35ac MY |
802 | <para>When using this operation on units without install information, a warning about it is shown. |
803 | <option>--no-warn</option> can be used to suppress the warning.</para> | |
804 | ||
e1fac8a6 ZJS |
805 | <para>Enabling units should not be confused with starting (activating) units, as done by the |
806 | <command>start</command> command. Enabling and starting units is orthogonal: units may be enabled without | |
807 | being started and started without being enabled. Enabling simply hooks the unit into various suggested | |
808 | places (for example, so that the unit is automatically started on boot or when a particular kind of | |
809 | hardware is plugged in). Starting actually spawns the daemon process (in case of service units), or binds | |
810 | the socket (in case of socket units), and so on.</para> | |
4a6022f0 | 811 | |
e1fac8a6 ZJS |
812 | <para>Depending on whether <option>--system</option>, <option>--user</option>, <option>--runtime</option>, |
813 | or <option>--global</option> is specified, this enables the unit for the system, for the calling user only, | |
814 | for only this boot of the system, or for all future logins of all users. Note that in the last case, no | |
815 | systemd daemon configuration is reloaded.</para> | |
4a6022f0 | 816 | |
e1fac8a6 ZJS |
817 | <para>Using <command>enable</command> on masked units is not supported and results in an error.</para> |
818 | </listitem> | |
819 | </varlistentry> | |
39c38ce1 | 820 | |
e1fac8a6 ZJS |
821 | <varlistentry> |
822 | <term><command>disable <replaceable>UNIT</replaceable>…</command></term> | |
4a6022f0 | 823 | |
e1fac8a6 ZJS |
824 | <listitem> |
825 | <para>Disables one or more units. This removes all symlinks to the unit files backing the specified units | |
826 | from the unit configuration directory, and hence undoes any changes made by <command>enable</command> or | |
827 | <command>link</command>. Note that this removes <emphasis>all</emphasis> symlinks to matching unit files, | |
828 | including manually created symlinks, and not just those actually created by <command>enable</command> or | |
829 | <command>link</command>. Note that while <command>disable</command> undoes the effect of | |
830 | <command>enable</command>, the two commands are otherwise not symmetric, as <command>disable</command> may | |
831 | remove more symlinks than a prior <command>enable</command> invocation of the same unit created.</para> | |
9ef15026 | 832 | |
e1fac8a6 | 833 | <para>This command expects valid unit names only, it does not accept paths to unit files.</para> |
9ef15026 | 834 | |
e1fac8a6 | 835 | <para>In addition to the units specified as arguments, all units are disabled that are listed in the |
bdac5608 | 836 | <varname>Also=</varname> setting contained in the [Install] section of any of the unit |
e1fac8a6 | 837 | files being operated on.</para> |
57ab2eab | 838 | |
e1fac8a6 ZJS |
839 | <para>This command implicitly reloads the system manager configuration after completing the operation. Note |
840 | that this command does not implicitly stop the units that are being disabled. If this is desired, either | |
841 | combine this command with the <option>--now</option> switch, or invoke the <command>stop</command> command | |
842 | with appropriate arguments later.</para> | |
57ab2eab | 843 | |
e1fac8a6 ZJS |
844 | <para>This command will print information about the file system operations (symlink removals) |
845 | executed. This output may be suppressed by passing <option>--quiet</option>. | |
846 | </para> | |
4a6022f0 | 847 | |
e774d3c9 MY |
848 | <para>When this command is used with <option>--user</option>, the units being operated on might |
849 | still be enabled in global scope, and thus get started automatically even after a successful | |
850 | disablement in user scope. In this case, a warning about it is shown, which can be suppressed | |
851 | using <option>--no-warn</option>.</para> | |
852 | ||
108d35ac MY |
853 | <para>This command honors <option>--system</option>, <option>--user</option>, <option>--runtime</option>, |
854 | <option>--global</option> and <option>--no-warn</option> in a similar way as <command>enable</command>.</para> | |
e1fac8a6 ZJS |
855 | </listitem> |
856 | </varlistentry> | |
4a6022f0 | 857 | |
e1fac8a6 ZJS |
858 | <varlistentry> |
859 | <term><command>reenable <replaceable>UNIT</replaceable>…</command></term> | |
4a6022f0 | 860 | |
e1fac8a6 ZJS |
861 | <listitem> |
862 | <para>Reenable one or more units, as specified on the command line. This is a combination of | |
863 | <command>disable</command> and <command>enable</command> and is useful to reset the symlinks a unit file is | |
bdac5608 | 864 | enabled with to the defaults configured in its [Install] section. This command expects |
e1fac8a6 ZJS |
865 | a unit name only, it does not accept paths to unit files.</para> |
866 | </listitem> | |
867 | </varlistentry> | |
4a6022f0 | 868 | |
e1fac8a6 ZJS |
869 | <varlistentry> |
870 | <term><command>preset <replaceable>UNIT</replaceable>…</command></term> | |
a330b376 | 871 | |
e1fac8a6 ZJS |
872 | <listitem> |
873 | <para>Reset the enable/disable status one or more unit files, as specified on | |
874 | the command line, to the defaults configured in the preset policy files. This | |
875 | has the same effect as <command>disable</command> or | |
876 | <command>enable</command>, depending how the unit is listed in the preset | |
877 | files.</para> | |
4a6022f0 | 878 | |
e1fac8a6 ZJS |
879 | <para>Use <option>--preset-mode=</option> to control whether units shall be |
880 | enabled and disabled, or only enabled, or only disabled.</para> | |
d309c1c3 | 881 | |
e1fac8a6 ZJS |
882 | <para>If the unit carries no install information, it will be silently ignored |
883 | by this command. <replaceable>UNIT</replaceable> must be the real unit name, | |
884 | any alias names are ignored silently.</para> | |
d309c1c3 | 885 | |
e1fac8a6 ZJS |
886 | <para>For more information on the preset policy format, see |
887 | <citerefentry><refentrytitle>systemd.preset</refentrytitle><manvolnum>5</manvolnum></citerefentry>. | |
7e215af7 | 888 | </para> |
e1fac8a6 ZJS |
889 | </listitem> |
890 | </varlistentry> | |
4a6022f0 | 891 | |
e1fac8a6 ZJS |
892 | <varlistentry> |
893 | <term><command>preset-all</command></term> | |
4a6022f0 | 894 | |
e1fac8a6 ZJS |
895 | <listitem> |
896 | <para>Resets all installed unit files to the defaults | |
897 | configured in the preset policy file (see above).</para> | |
4a6022f0 | 898 | |
e1fac8a6 ZJS |
899 | <para>Use <option>--preset-mode=</option> to control |
900 | whether units shall be enabled and disabled, or only | |
901 | enabled, or only disabled.</para> | |
902 | </listitem> | |
903 | </varlistentry> | |
4a6022f0 | 904 | |
27722f96 | 905 | <varlistentry> |
e1fac8a6 | 906 | <term><command>is-enabled <replaceable>UNIT</replaceable>…</command></term> |
4a6022f0 | 907 | |
27722f96 | 908 | <listitem> |
e1fac8a6 ZJS |
909 | <para>Checks whether any of the specified unit files are |
910 | enabled (as with <command>enable</command>). Returns an | |
911 | exit code of 0 if at least one is enabled, non-zero | |
912 | otherwise. Prints the current enable status (see table). | |
913 | To suppress this output, use <option>--quiet</option>. | |
914 | To show installation targets, use <option>--full</option>. | |
915 | </para> | |
6fdbb3c8 | 916 | |
e1fac8a6 ZJS |
917 | <table> |
918 | <title> | |
919 | <command>is-enabled</command> output | |
920 | </title> | |
6fdbb3c8 | 921 | |
e1fac8a6 ZJS |
922 | <tgroup cols='3'> |
923 | <thead> | |
924 | <row> | |
925 | <entry>Name</entry> | |
926 | <entry>Description</entry> | |
927 | <entry>Exit Code</entry> | |
928 | </row> | |
929 | </thead> | |
930 | <tbody> | |
931 | <row> | |
932 | <entry><literal>enabled</literal></entry> | |
933 | <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> | |
934 | <entry morerows='1'>0</entry> | |
935 | </row> | |
936 | <row> | |
937 | <entry><literal>enabled-runtime</literal></entry> | |
938 | </row> | |
939 | <row> | |
940 | <entry><literal>linked</literal></entry> | |
941 | <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> | |
942 | <entry morerows='1'>> 0</entry> | |
943 | </row> | |
944 | <row> | |
945 | <entry><literal>linked-runtime</literal></entry> | |
946 | </row> | |
15d7ab87 ZJS |
947 | <row> |
948 | <entry><literal>alias</literal></entry> | |
949 | <entry>The name is an alias (symlink to another unit file).</entry> | |
950 | <entry>0</entry> | |
951 | </row> | |
e1fac8a6 ZJS |
952 | <row> |
953 | <entry><literal>masked</literal></entry> | |
954 | <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> | |
955 | <entry morerows='1'>> 0</entry> | |
956 | </row> | |
957 | <row> | |
958 | <entry><literal>masked-runtime</literal></entry> | |
959 | </row> | |
960 | <row> | |
961 | <entry><literal>static</literal></entry> | |
bdac5608 | 962 | <entry>The unit file is not enabled, and has no provisions for enabling in the [Install] unit file section.</entry> |
e1fac8a6 ZJS |
963 | <entry>0</entry> |
964 | </row> | |
965 | <row> | |
966 | <entry><literal>indirect</literal></entry> | |
bdac5608 | 967 | <entry>The unit file itself is not enabled, but it has a non-empty <varname>Also=</varname> setting in the [Install] 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 <varname>Also=</varname>. For template unit files, an instance different than the one specified in <varname>DefaultInstance=</varname> is enabled.</entry> |
e1fac8a6 ZJS |
968 | <entry>0</entry> |
969 | </row> | |
970 | <row> | |
971 | <entry><literal>disabled</literal></entry> | |
bdac5608 | 972 | <entry>The unit file is not enabled, but contains an [Install] section with installation instructions.</entry> |
e1fac8a6 ZJS |
973 | <entry>> 0</entry> |
974 | </row> | |
975 | <row> | |
976 | <entry><literal>generated</literal></entry> | |
977 | <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> | |
978 | <entry>0</entry> | |
979 | </row> | |
980 | <row> | |
981 | <entry><literal>transient</literal></entry> | |
982 | <entry>The unit file has been created dynamically with the runtime API. Transient units may not be enabled.</entry> | |
983 | <entry>0</entry> | |
984 | </row> | |
985 | <row> | |
986 | <entry><literal>bad</literal></entry> | |
987 | <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> | |
988 | <entry>> 0</entry> | |
989 | </row> | |
8f23229c MY |
990 | <row> |
991 | <entry><literal>not-found</literal></entry> | |
992 | <entry>The unit file doesn't exist.</entry> | |
993 | <entry>4</entry> | |
994 | </row> | |
e1fac8a6 ZJS |
995 | </tbody> |
996 | </tgroup> | |
997 | </table> | |
6fdbb3c8 | 998 | |
27722f96 LN |
999 | </listitem> |
1000 | </varlistentry> | |
991f2a39 | 1001 | |
27722f96 | 1002 | <varlistentry> |
e1fac8a6 | 1003 | <term><command>mask <replaceable>UNIT</replaceable>…</command></term> |
27722f96 LN |
1004 | |
1005 | <listitem> | |
e1fac8a6 ZJS |
1006 | <para>Mask one or more units, as specified on the command line. This will link these unit files to |
1007 | <filename>/dev/null</filename>, making it impossible to start them. This is a stronger version of | |
1008 | <command>disable</command>, since it prohibits all kinds of activation of the unit, including enablement | |
1009 | and manual activation. Use this option with care. This honors the <option>--runtime</option> option to only | |
1010 | mask temporarily until the next reboot of the system. The <option>--now</option> option may be used to | |
1011 | ensure that the units are also stopped. This command expects valid unit names only, it does not accept unit | |
1012 | file paths.</para> | |
27722f96 LN |
1013 | </listitem> |
1014 | </varlistentry> | |
1015 | ||
cbb76c29 | 1016 | <varlistentry> |
e1fac8a6 | 1017 | <term><command>unmask <replaceable>UNIT</replaceable>…</command></term> |
cbb76c29 LP |
1018 | |
1019 | <listitem> | |
e1fac8a6 ZJS |
1020 | <para>Unmask one or more unit files, as specified on the command line. This will undo the effect of |
1021 | <command>mask</command>. This command expects valid unit names only, it does not accept unit file | |
1022 | paths.</para> | |
1023 | </listitem> | |
1024 | </varlistentry> | |
cbb76c29 | 1025 | |
e1fac8a6 ZJS |
1026 | <varlistentry> |
1027 | <term><command>link <replaceable>PATH</replaceable>…</command></term> | |
ccdda955 | 1028 | |
e1fac8a6 | 1029 | <listitem> |
32d2e70a | 1030 | <para>Link a unit file that is not in the unit file search path into the unit file search path. This |
e1fac8a6 ZJS |
1031 | command expects an absolute path to a unit file. The effect of this may be undone with |
1032 | <command>disable</command>. The effect of this command is that a unit file is made available for commands | |
1033 | such as <command>start</command>, even though it is not installed directly in the unit search path. The | |
1034 | file system where the linked unit files are located must be accessible when systemd is started | |
3b121157 | 1035 | (e.g. anything underneath <filename>/home/</filename> or <filename>/var/</filename> is not allowed, unless |
e1fac8a6 | 1036 | those directories are located on the root file system).</para> |
cbb76c29 LP |
1037 | </listitem> |
1038 | </varlistentry> | |
1039 | ||
27722f96 | 1040 | <varlistentry> |
e1fac8a6 | 1041 | <term><command>revert <replaceable>UNIT</replaceable>…</command></term> |
27722f96 LN |
1042 | |
1043 | <listitem> | |
e1fac8a6 ZJS |
1044 | <para>Revert one or more unit files to their vendor versions. This command removes drop-in configuration |
1045 | files that modify the specified units, as well as any user-configured unit file that overrides a matching | |
1046 | vendor supplied unit file. Specifically, for a unit <literal>foo.service</literal> the matching directories | |
1047 | <literal>foo.service.d/</literal> with all their contained files are removed, both below the persistent and | |
1048 | runtime configuration directories (i.e. below <filename>/etc/systemd/system</filename> and | |
1049 | <filename>/run/systemd/system</filename>); if the unit file has a vendor-supplied version (i.e. a unit file | |
3b121157 | 1050 | located below <filename>/usr/</filename>) any matching persistent or runtime unit file that overrides it is |
e1fac8a6 ZJS |
1051 | removed, too. Note that if a unit file has no vendor-supplied version (i.e. is only defined below |
1052 | <filename>/etc/systemd/system</filename> or <filename>/run/systemd/system</filename>, but not in a unit | |
3b121157 | 1053 | file stored below <filename>/usr/</filename>), then it is not removed. Also, if a unit is masked, it is |
e1fac8a6 ZJS |
1054 | unmasked.</para> |
1055 | ||
1056 | <para>Effectively, this command may be used to undo all changes made with <command>systemctl | |
1057 | edit</command>, <command>systemctl set-property</command> and <command>systemctl mask</command> and puts | |
1058 | the original unit file with its settings back in effect.</para> | |
27722f96 LN |
1059 | </listitem> |
1060 | </varlistentry> | |
e1fac8a6 | 1061 | |
27722f96 | 1062 | <varlistentry> |
e1fac8a6 ZJS |
1063 | <term><command>add-wants <replaceable>TARGET</replaceable> |
1064 | <replaceable>UNIT</replaceable>…</command></term> | |
1065 | <term><command>add-requires <replaceable>TARGET</replaceable> | |
1066 | <replaceable>UNIT</replaceable>…</command></term> | |
27722f96 LN |
1067 | |
1068 | <listitem> | |
e1fac8a6 ZJS |
1069 | <para>Adds <literal>Wants=</literal> or <literal>Requires=</literal> |
1070 | dependencies, respectively, to the specified | |
1071 | <replaceable>TARGET</replaceable> for one or more units. </para> | |
1072 | ||
1073 | <para>This command honors <option>--system</option>, | |
1074 | <option>--user</option>, <option>--runtime</option> and | |
1075 | <option>--global</option> in a way similar to | |
1076 | <command>enable</command>.</para> | |
4f0acdb3 | 1077 | |
27722f96 LN |
1078 | </listitem> |
1079 | </varlistentry> | |
e1fac8a6 | 1080 | |
27722f96 | 1081 | <varlistentry> |
e1fac8a6 | 1082 | <term><command>edit <replaceable>UNIT</replaceable>…</command></term> |
27722f96 LN |
1083 | |
1084 | <listitem> | |
e1fac8a6 ZJS |
1085 | <para>Edit a drop-in snippet or a whole replacement file if |
1086 | <option>--full</option> is specified, to extend or override the | |
1087 | specified unit.</para> | |
27722f96 | 1088 | |
e1fac8a6 ZJS |
1089 | <para>Depending on whether <option>--system</option> (the default), |
1090 | <option>--user</option>, or <option>--global</option> is specified, | |
1091 | this command creates a drop-in file for each unit either for the system, | |
1092 | for the calling user, or for all futures logins of all users. Then, | |
1093 | the editor (see the "Environment" section below) is invoked on | |
1094 | temporary files which will be written to the real location if the | |
1095 | editor exits successfully.</para> | |
27722f96 | 1096 | |
f206809b MY |
1097 | <para>If <option>--drop-in=</option> is specified, the given drop-in file name |
1098 | will be used instead of the default <filename>override.conf</filename>.</para> | |
1099 | ||
e1fac8a6 ZJS |
1100 | <para>If <option>--full</option> is specified, this will copy the |
1101 | original units instead of creating drop-in files.</para> | |
27722f96 | 1102 | |
e1fac8a6 ZJS |
1103 | <para>If <option>--force</option> is specified and any units do |
1104 | not already exist, new unit files will be opened for editing.</para> | |
c4f2aaa4 | 1105 | |
e1fac8a6 | 1106 | <para>If <option>--runtime</option> is specified, the changes will |
3b121157 | 1107 | be made temporarily in <filename>/run/</filename> and they will be |
e1fac8a6 ZJS |
1108 | lost on the next reboot.</para> |
1109 | ||
1110 | <para>If the temporary file is empty upon exit, the modification of | |
1111 | the related unit is canceled.</para> | |
1112 | ||
1113 | <para>After the units have been edited, systemd configuration is | |
1114 | reloaded (in a way that is equivalent to <command>daemon-reload</command>). | |
1115 | </para> | |
1116 | ||
1117 | <para>Note that this command cannot be used to remotely edit units | |
1118 | and that you cannot temporarily edit units which are in | |
3b121157 ZJS |
1119 | <filename>/etc/</filename>, since they take precedence over |
1120 | <filename>/run/</filename>.</para> | |
27722f96 LN |
1121 | </listitem> |
1122 | </varlistentry> | |
e1fac8a6 | 1123 | |
27722f96 | 1124 | <varlistentry> |
e1fac8a6 | 1125 | <term><command>get-default</command></term> |
27722f96 LN |
1126 | |
1127 | <listitem> | |
e1fac8a6 ZJS |
1128 | <para>Return the default target to boot into. This returns |
1129 | the target unit name <filename>default.target</filename> | |
1130 | is aliased (symlinked) to.</para> | |
27722f96 LN |
1131 | </listitem> |
1132 | </varlistentry> | |
e1fac8a6 | 1133 | |
27722f96 | 1134 | <varlistentry> |
e1fac8a6 | 1135 | <term><command>set-default <replaceable>TARGET</replaceable></command></term> |
27722f96 LN |
1136 | |
1137 | <listitem> | |
e1fac8a6 ZJS |
1138 | <para>Set the default target to boot into. This sets |
1139 | (symlinks) the <filename>default.target</filename> alias | |
1140 | to the given target unit.</para> | |
27722f96 LN |
1141 | </listitem> |
1142 | </varlistentry> | |
e1fac8a6 ZJS |
1143 | |
1144 | </variablelist> | |
1145 | </refsect2> | |
1146 | ||
1147 | <refsect2> | |
1148 | <title>Machine Commands</title> | |
1149 | ||
1150 | <variablelist> | |
27722f96 | 1151 | <varlistentry> |
e1fac8a6 | 1152 | <term><command>list-machines</command> <optional><replaceable>PATTERN</replaceable>…</optional></term> |
27722f96 LN |
1153 | |
1154 | <listitem> | |
e1fac8a6 ZJS |
1155 | <para>List the host and all running local containers with |
1156 | their state. If one or more | |
1157 | <replaceable>PATTERN</replaceable>s are specified, only | |
1158 | containers matching one of them are shown. | |
1159 | </para> | |
27722f96 LN |
1160 | </listitem> |
1161 | </varlistentry> | |
e1fac8a6 ZJS |
1162 | </variablelist> |
1163 | </refsect2> | |
1164 | ||
1165 | <refsect2> | |
1166 | <title>Job Commands</title> | |
1167 | ||
1168 | <variablelist> | |
27722f96 | 1169 | <varlistentry> |
e1fac8a6 | 1170 | <term><command>list-jobs <optional><replaceable>PATTERN…</replaceable></optional></command></term> |
27722f96 LN |
1171 | |
1172 | <listitem> | |
e1fac8a6 ZJS |
1173 | <para>List jobs that are in progress. If one or more |
1174 | <replaceable>PATTERN</replaceable>s are specified, only | |
1175 | jobs for units matching one of them are shown.</para> | |
27722f96 | 1176 | |
e1fac8a6 ZJS |
1177 | <para>When combined with <option>--after</option> or <option>--before</option> the list is augmented with |
1178 | information on which other job each job is waiting for, and which other jobs are waiting for it, see | |
1179 | above.</para> | |
27722f96 LN |
1180 | </listitem> |
1181 | </varlistentry> | |
1182 | <varlistentry> | |
7e0aaeb2 | 1183 | <term><command>cancel <optional><replaceable>JOB</replaceable>…</optional></command></term> |
27722f96 LN |
1184 | |
1185 | <listitem> | |
e1fac8a6 ZJS |
1186 | <para>Cancel one or more jobs specified on the command line |
1187 | by their numeric job IDs. If no job ID is specified, cancel | |
1188 | all pending jobs.</para> | |
27722f96 LN |
1189 | </listitem> |
1190 | </varlistentry> | |
e1fac8a6 ZJS |
1191 | </variablelist> |
1192 | </refsect2> | |
1193 | ||
1194 | <refsect2> | |
1195 | <title>Environment Commands</title> | |
1196 | ||
0dc9fd56 ZJS |
1197 | <para><command>systemd</command> supports an environment block that is passed to processes the manager |
1198 | spawns. The names of the variables can contain ASCII letters, digits, and the underscore | |
1199 | character. Variable names cannot be empty or start with a digit. In variable values, most characters | |
30927a24 ZJS |
1200 | are allowed, but the whole sequence must be valid UTF-8. (Note that control characters like newline |
1201 | (<constant>NL</constant>), tab (<constant>TAB</constant>), or the escape character | |
1202 | (<constant>ESC</constant>), <emphasis>are</emphasis> valid ASCII and thus valid UTF-8). The total | |
1203 | length of the environment block is limited to <constant>_SC_ARG_MAX</constant> value defined by | |
0dc9fd56 ZJS |
1204 | <citerefentry project='man-pages'><refentrytitle>sysconf</refentrytitle><manvolnum>3</manvolnum></citerefentry>. |
1205 | </para> | |
1206 | ||
e1fac8a6 | 1207 | <variablelist> |
8c8208cb | 1208 | <varlistentry> |
e1fac8a6 | 1209 | <term><command>show-environment</command></term> |
8c8208cb LP |
1210 | |
1211 | <listitem> | |
e1fac8a6 ZJS |
1212 | <para>Dump the systemd manager environment block. This is the environment |
1213 | block that is passed to all processes the manager spawns. The environment | |
4bb37359 | 1214 | block will be dumped in straightforward form suitable for sourcing into |
e1fac8a6 ZJS |
1215 | most shells. If no special characters or whitespace is present in the variable |
1216 | values, no escaping is performed, and the assignments have the form | |
1217 | <literal>VARIABLE=value</literal>. If whitespace or characters which have | |
1218 | special meaning to the shell are present, dollar-single-quote escaping is | |
1219 | used, and assignments have the form <literal>VARIABLE=$'value'</literal>. | |
1220 | This syntax is known to be supported by | |
1221 | <citerefentry project='die-net'><refentrytitle>bash</refentrytitle><manvolnum>1</manvolnum></citerefentry>, | |
1222 | <citerefentry project='die-net'><refentrytitle>zsh</refentrytitle><manvolnum>1</manvolnum></citerefentry>, | |
1223 | <citerefentry project='die-net'><refentrytitle>ksh</refentrytitle><manvolnum>1</manvolnum></citerefentry>, | |
1224 | and | |
1225 | <citerefentry project='die-net'><refentrytitle>busybox</refentrytitle><manvolnum>1</manvolnum></citerefentry>'s | |
1226 | <citerefentry project='die-net'><refentrytitle>ash</refentrytitle><manvolnum>1</manvolnum></citerefentry>, | |
1227 | but not | |
1228 | <citerefentry project='die-net'><refentrytitle>dash</refentrytitle><manvolnum>1</manvolnum></citerefentry> | |
1229 | or | |
1230 | <citerefentry project='die-net'><refentrytitle>fish</refentrytitle><manvolnum>1</manvolnum></citerefentry>. | |
1231 | </para> | |
8c8208cb LP |
1232 | </listitem> |
1233 | </varlistentry> | |
27722f96 | 1234 | <varlistentry> |
e1fac8a6 | 1235 | <term><command>set-environment <replaceable>VARIABLE=VALUE</replaceable>…</command></term> |
27722f96 LN |
1236 | |
1237 | <listitem> | |
0dc9fd56 ZJS |
1238 | <para>Set one or more systemd manager environment variables, as specified on the command |
1239 | line. This command will fail if variable names and values do not conform to the rules listed | |
1240 | above.</para> | |
27722f96 LN |
1241 | </listitem> |
1242 | </varlistentry> | |
1243 | <varlistentry> | |
e1fac8a6 | 1244 | <term><command>unset-environment <replaceable>VARIABLE</replaceable>…</command></term> |
27722f96 LN |
1245 | |
1246 | <listitem> | |
e1fac8a6 ZJS |
1247 | <para>Unset one or more systemd manager environment |
1248 | variables. If only a variable name is specified, it will be | |
1249 | removed regardless of its value. If a variable and a value | |
1250 | are specified, the variable is only removed if it has the | |
1251 | specified value.</para> | |
27722f96 LN |
1252 | </listitem> |
1253 | </varlistentry> | |
1254 | <varlistentry> | |
e1fac8a6 ZJS |
1255 | <term> |
1256 | <command>import-environment</command> | |
32854f70 | 1257 | <replaceable>VARIABLE…</replaceable> |
e1fac8a6 | 1258 | </term> |
27722f96 LN |
1259 | |
1260 | <listitem> | |
0dc9fd56 | 1261 | <para>Import all, one or more environment variables set on the client into the systemd manager |
82651d5b ZJS |
1262 | environment block. If a list of environment variable names is passed, client-side values are then |
1263 | imported into the manager's environment block. If any names are not valid environment variable | |
1264 | names or have invalid values according to the rules described above, an error is raised. If no | |
1265 | arguments are passed, the entire environment block inherited by the <command>systemctl</command> | |
1266 | process is imported. In this mode, any inherited invalid environment variables are quietly | |
1267 | ignored.</para> | |
32854f70 ZJS |
1268 | |
1269 | <para>Importing of the full inherited environment block (calling this command without any | |
1270 | arguments) is deprecated. A shell will set dozens of variables which only make sense locally and | |
1271 | are only meant for processes which are descendants of the shell. Such variables in the global | |
1272 | environment block are confusing to other processes.</para> | |
27722f96 LN |
1273 | </listitem> |
1274 | </varlistentry> | |
e1fac8a6 ZJS |
1275 | </variablelist> |
1276 | </refsect2> | |
1277 | ||
1278 | <refsect2> | |
38fcb7f7 | 1279 | <title>Manager State Commands</title> |
e1fac8a6 ZJS |
1280 | |
1281 | <variablelist> | |
27722f96 | 1282 | <varlistentry> |
e1fac8a6 | 1283 | <term><command>daemon-reload</command></term> |
27722f96 LN |
1284 | |
1285 | <listitem> | |
e1fac8a6 ZJS |
1286 | <para>Reload the systemd manager configuration. This will |
1287 | rerun all generators (see | |
1288 | <citerefentry><refentrytitle>systemd.generator</refentrytitle><manvolnum>7</manvolnum></citerefentry>), | |
1289 | reload all unit files, and recreate the entire dependency | |
1290 | tree. While the daemon is being reloaded, all sockets | |
1291 | systemd listens on behalf of user configuration will stay | |
1292 | accessible.</para> | |
33d2308c | 1293 | |
e1fac8a6 ZJS |
1294 | <para>This command should not be confused with the |
1295 | <command>reload</command> command.</para> | |
27722f96 LN |
1296 | </listitem> |
1297 | </varlistentry> | |
38fcb7f7 | 1298 | |
e93c33d4 | 1299 | <varlistentry> |
e1fac8a6 | 1300 | <term><command>daemon-reexec</command></term> |
27722f96 | 1301 | |
e93c33d4 | 1302 | <listitem> |
e1fac8a6 ZJS |
1303 | <para>Reexecute the systemd manager. This will serialize the |
1304 | manager state, reexecute the process and deserialize the | |
1305 | state again. This command is of little use except for | |
1306 | debugging and package upgrades. Sometimes, it might be | |
1307 | helpful as a heavy-weight <command>daemon-reload</command>. | |
1308 | While the daemon is being reexecuted, all sockets systemd listening | |
1309 | on behalf of user configuration will stay accessible. | |
1310 | </para> | |
e93c33d4 SL |
1311 | </listitem> |
1312 | </varlistentry> | |
38fcb7f7 | 1313 | |
df957849 | 1314 | <varlistentry id='log-level'> |
38fcb7f7 ZJS |
1315 | <term><command>log-level</command> [<replaceable>LEVEL</replaceable>]</term> |
1316 | ||
1317 | <listitem><para>If no argument is given, print the current log level of the manager. If an | |
1318 | optional argument <replaceable>LEVEL</replaceable> is provided, then the command changes the | |
1319 | current log level of the manager to <replaceable>LEVEL</replaceable> (accepts the same values as | |
1320 | <option>--log-level=</option> described in | |
1321 | <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>). | |
1322 | </para></listitem> | |
1323 | </varlistentry> | |
1324 | ||
1325 | <varlistentry> | |
1326 | <term><command>log-target</command> [<replaceable>TARGET</replaceable>]</term> | |
1327 | ||
1328 | <listitem><para>If no argument is given, print the current log target of the manager. If an | |
1329 | optional argument <replaceable>TARGET</replaceable> is provided, then the command changes the | |
1330 | current log target of the manager to <replaceable>TARGET</replaceable> (accepts the same values as | |
1331 | <option>--log-target=</option>, described in | |
1332 | <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>). | |
1333 | </para></listitem> | |
1334 | </varlistentry> | |
6ab86319 ZJS |
1335 | |
1336 | <varlistentry> | |
1337 | <term><command>service-watchdogs</command> [yes|no]</term> | |
1338 | ||
1339 | <listitem><para>If no argument is given, print the current state of service runtime watchdogs of | |
1340 | the manager. If an optional boolean argument is provided, then globally enables or disables the | |
1341 | service runtime watchdogs (<option>WatchdogSec=</option>) and emergency actions (e.g. | |
1342 | <option>OnFailure=</option> or <option>StartLimitAction=</option>); see | |
1343 | <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>. | |
1344 | The hardware watchdog is not affected by this setting.</para></listitem> | |
1345 | </varlistentry> | |
e1fac8a6 ZJS |
1346 | </variablelist> |
1347 | </refsect2> | |
27722f96 | 1348 | |
e1fac8a6 ZJS |
1349 | <refsect2> |
1350 | <title>System Commands</title> | |
e9fd88f2 | 1351 | |
e1fac8a6 ZJS |
1352 | <variablelist> |
1353 | <varlistentry> | |
1354 | <term><command>is-system-running</command></term> | |
5b792edb | 1355 | |
e1fac8a6 ZJS |
1356 | <listitem> |
1357 | <para>Checks whether the system is operational. This | |
1358 | returns success (exit code 0) when the system is fully up | |
1359 | and running, specifically not in startup, shutdown or | |
1360 | maintenance mode, and with no failed services. Failure is | |
1361 | returned otherwise (exit code non-zero). In addition, the | |
1362 | current state is printed in a short string to standard | |
1363 | output, see the table below. Use <option>--quiet</option> to | |
1364 | suppress this output.</para> | |
5b792edb | 1365 | |
e1fac8a6 ZJS |
1366 | <para>Use <option>--wait</option> to wait until the boot |
1367 | process is completed before printing the current state and | |
1368 | returning the appropriate error status. If <option>--wait</option> | |
1369 | is in use, states <varname>initializing</varname> or | |
1370 | <varname>starting</varname> will not be reported, instead | |
1371 | the command will block until a later state (such as | |
1372 | <varname>running</varname> or <varname>degraded</varname>) | |
1373 | is reached.</para> | |
5b792edb | 1374 | |
e1fac8a6 ZJS |
1375 | <table> |
1376 | <title><command>is-system-running</command> output</title> | |
1377 | <tgroup cols='3'> | |
1378 | <colspec colname='name'/> | |
1379 | <colspec colname='description'/> | |
1380 | <colspec colname='exit-code'/> | |
1381 | <thead> | |
1382 | <row> | |
1383 | <entry>Name</entry> | |
1384 | <entry>Description</entry> | |
1385 | <entry>Exit Code</entry> | |
1386 | </row> | |
1387 | </thead> | |
1388 | <tbody> | |
1389 | <row> | |
1390 | <entry><varname>initializing</varname></entry> | |
1391 | <entry><para>Early bootup, before | |
1392 | <filename>basic.target</filename> is reached | |
1393 | or the <varname>maintenance</varname> state entered. | |
1394 | </para></entry> | |
1395 | <entry>> 0</entry> | |
1396 | </row> | |
1397 | <row> | |
1398 | <entry><varname>starting</varname></entry> | |
1399 | <entry><para>Late bootup, before the job queue | |
1400 | becomes idle for the first time, or one of the | |
1401 | rescue targets are reached.</para></entry> | |
1402 | <entry>> 0</entry> | |
1403 | </row> | |
1404 | <row> | |
1405 | <entry><varname>running</varname></entry> | |
1406 | <entry><para>The system is fully | |
1407 | operational.</para></entry> | |
1408 | <entry>0</entry> | |
1409 | </row> | |
1410 | <row> | |
1411 | <entry><varname>degraded</varname></entry> | |
1412 | <entry><para>The system is operational but one or more | |
1413 | units failed.</para></entry> | |
1414 | <entry>> 0</entry> | |
1415 | </row> | |
1416 | <row> | |
1417 | <entry><varname>maintenance</varname></entry> | |
1418 | <entry><para>The rescue or emergency target is | |
1419 | active.</para></entry> | |
1420 | <entry>> 0</entry> | |
1421 | </row> | |
1422 | <row> | |
1423 | <entry><varname>stopping</varname></entry> | |
1424 | <entry><para>The manager is shutting | |
1425 | down.</para></entry> | |
1426 | <entry>> 0</entry> | |
1427 | </row> | |
1428 | <row> | |
1429 | <entry><varname>offline</varname></entry> | |
1430 | <entry><para>The manager is not | |
1431 | running. Specifically, this is the operational | |
1432 | state if an incompatible program is running as | |
1433 | system manager (PID 1).</para></entry> | |
1434 | <entry>> 0</entry> | |
1435 | </row> | |
1436 | <row> | |
1437 | <entry><varname>unknown</varname></entry> | |
1438 | <entry><para>The operational state could not be | |
1439 | determined, due to lack of resources or another | |
1440 | error cause.</para></entry> | |
1441 | <entry>> 0</entry> | |
1442 | </row> | |
1443 | </tbody> | |
1444 | </tgroup> | |
1445 | </table> | |
27722f96 LN |
1446 | </listitem> |
1447 | </varlistentry> | |
1448 | ||
1449 | <varlistentry> | |
e1fac8a6 | 1450 | <term><command>default</command></term> |
27722f96 LN |
1451 | |
1452 | <listitem> | |
e1fac8a6 ZJS |
1453 | <para>Enter default mode. This is equivalent to <command>systemctl isolate default.target</command>. This |
1454 | operation is blocking by default, use <option>--no-block</option> to request asynchronous behavior.</para> | |
27722f96 LN |
1455 | </listitem> |
1456 | </varlistentry> | |
1457 | ||
1458 | <varlistentry> | |
e1fac8a6 | 1459 | <term><command>rescue</command></term> |
27722f96 LN |
1460 | |
1461 | <listitem> | |
e1fac8a6 ZJS |
1462 | <para>Enter rescue mode. This is equivalent to <command>systemctl isolate rescue.target</command>. This |
1463 | operation is blocking by default, use <option>--no-block</option> to request asynchronous behavior.</para> | |
27722f96 LN |
1464 | </listitem> |
1465 | </varlistentry> | |
27722f96 | 1466 | <varlistentry> |
e1fac8a6 | 1467 | <term><command>emergency</command></term> |
27722f96 LN |
1468 | |
1469 | <listitem> | |
e1fac8a6 ZJS |
1470 | <para>Enter emergency mode. This is equivalent to <command>systemctl isolate |
1471 | emergency.target</command>. This operation is blocking by default, use <option>--no-block</option> to | |
1472 | request asynchronous behavior.</para> | |
27722f96 LN |
1473 | </listitem> |
1474 | </varlistentry> | |
27722f96 | 1475 | <varlistentry> |
e1fac8a6 | 1476 | <term><command>halt</command></term> |
27722f96 LN |
1477 | |
1478 | <listitem> | |
e1fac8a6 ZJS |
1479 | <para>Shut down and halt the system. This is mostly equivalent to <command>systemctl start halt.target |
1480 | --job-mode=replace-irreversibly --no-block</command>, but also prints a wall message to all users. This command is | |
1481 | asynchronous; it will return after the halt operation is enqueued, without waiting for it to complete. Note | |
1482 | that this operation will simply halt the OS kernel after shutting down, leaving the hardware powered | |
1483 | on. Use <command>systemctl poweroff</command> for powering off the system (see below).</para> | |
1484 | ||
1485 | <para>If combined with <option>--force</option>, shutdown of all running services is skipped, however all | |
1486 | processes are killed and all file systems are unmounted or mounted read-only, immediately followed by the | |
1487 | system halt. If <option>--force</option> is specified twice, the operation is immediately executed without | |
1488 | terminating any processes or unmounting any file systems. This may result in data loss. Note that when | |
1489 | <option>--force</option> is specified twice the halt operation is executed by <command>systemctl</command> | |
1490 | itself, and the system manager is not contacted. This means the command should succeed even when the system | |
1491 | manager has crashed.</para> | |
1433e1f9 MY |
1492 | |
1493 | <para>If combined with <option>--when=</option>, shutdown will be scheduled after the given timestamp. | |
1494 | And <option>--when=cancel</option> will cancel the shutdown.</para> | |
27722f96 LN |
1495 | </listitem> |
1496 | </varlistentry> | |
27722f96 | 1497 | <varlistentry> |
e1fac8a6 | 1498 | <term><command>poweroff</command></term> |
27722f96 LN |
1499 | |
1500 | <listitem> | |
e1fac8a6 ZJS |
1501 | <para>Shut down and power-off the system. This is mostly equivalent to <command>systemctl start |
1502 | poweroff.target --job-mode=replace-irreversibly --no-block</command>, but also prints a wall message to all | |
1503 | users. This command is asynchronous; it will return after the power-off operation is enqueued, without | |
1504 | waiting for it to complete.</para> | |
27722f96 | 1505 | |
1433e1f9 MY |
1506 | <para>This command honors <option>--force</option> and <option>--when=</option> in a similar way |
1507 | as <command>halt</command>.</para> | |
e1fac8a6 ZJS |
1508 | </listitem> |
1509 | </varlistentry> | |
1510 | <varlistentry> | |
dae710be | 1511 | <term><command>reboot</command></term> |
27722f96 | 1512 | |
e1fac8a6 | 1513 | <listitem> |
76c068b7 ZJS |
1514 | <para>Shut down and reboot the system.</para> |
1515 | ||
1516 | <para>This command mostly equivalent to <command>systemctl start reboot.target | |
1517 | --job-mode=replace-irreversibly --no-block</command>, but also prints a wall message to all | |
1518 | users. This command is asynchronous; it will return after the reboot operation is enqueued, | |
1519 | without waiting for it to complete.</para> | |
3990961d | 1520 | |
dae710be | 1521 | <para>If the switch <option>--reboot-argument=</option> is given, it will be passed as the optional |
e1fac8a6 | 1522 | argument to the <citerefentry><refentrytitle>reboot</refentrytitle><manvolnum>2</manvolnum></citerefentry> |
dae710be | 1523 | system call.</para> |
76c068b7 ZJS |
1524 | |
1525 | <para>Options <option>--boot-loader-entry=</option>, <option>--boot-loader-menu=</option>, and | |
1526 | <option>--firmware-setup</option> can be used to select what to do <emphasis>after</emphasis> the | |
1527 | reboot. See the descriptions of those options for details.</para> | |
1433e1f9 MY |
1528 | |
1529 | <para>This command honors <option>--force</option> and <option>--when=</option> in a similar way | |
1530 | as <command>halt</command>.</para> | |
27722f96 LN |
1531 | </listitem> |
1532 | </varlistentry> | |
1533 | ||
1534 | <varlistentry> | |
e1fac8a6 | 1535 | <term><command>kexec</command></term> |
27722f96 LN |
1536 | |
1537 | <listitem> | |
fb12f140 ZJS |
1538 | <para>Shut down and reboot the system via <command>kexec</command>. This command will load a |
1539 | kexec kernel if one wasn't loaded yet or fail. A kernel may be loaded earlier by a separate step, | |
1540 | this is particularly useful if a custom initrd or additional kernel commandline options are | |
1541 | desired. The <option>--force</option> can be used to continue without a kexec kernel, i.e. to | |
1542 | perform a normal reboot. The final reboot step is equivalent to | |
1543 | <command>systemctl start kexec.target --job-mode=replace-irreversibly --no-block</command>. | |
1544 | </para> | |
3990961d | 1545 | |
fb12f140 ZJS |
1546 | <para>To load a kernel, an enumeration is performed following the |
1547 | <ulink url="https://uapi-group.org/specifications/specs/boot_loader_specification">Boot Loader Specification</ulink>, | |
1548 | and the default boot entry is loaded. For this step to succeed, the system must be using UEFI | |
1549 | and the boot loader entries must be configured appropriately. <command>bootctl list</command> | |
1550 | may be used to list boot entries, see | |
1551 | <citerefentry><refentrytitle>bootctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>. | |
1552 | </para> | |
1553 | ||
1554 | <para>This command is asynchronous; it will return after the reboot operation is enqueued, | |
1555 | without waiting for it to complete.</para> | |
1556 | ||
1557 | <para>This command honors <option>--force</option> and <option>--when=</option> similarly | |
1558 | to <command>halt</command>.</para> | |
e1fac8a6 ZJS |
1559 | </listitem> |
1560 | </varlistentry> | |
3990961d | 1561 | |
e1fac8a6 ZJS |
1562 | <varlistentry> |
1563 | <term><command>exit</command> <optional><replaceable>EXIT_CODE</replaceable></optional></term> | |
3990961d | 1564 | |
e1fac8a6 ZJS |
1565 | <listitem> |
1566 | <para>Ask the service manager to quit. This is only supported for user service managers (i.e. in | |
1567 | conjunction with the <option>--user</option> option) or in containers and is equivalent to | |
1568 | <command>poweroff</command> otherwise. This command is asynchronous; it will return after the exit | |
1569 | operation is enqueued, without waiting for it to complete.</para> | |
27722f96 | 1570 | |
e1fac8a6 ZJS |
1571 | <para>The service manager will exit with the specified exit code, if |
1572 | <replaceable>EXIT_CODE</replaceable> is passed.</para> | |
27722f96 LN |
1573 | </listitem> |
1574 | </varlistentry> | |
1575 | ||
b619ec8f | 1576 | <varlistentry> |
5ae89ef3 | 1577 | <term><command>switch-root</command> <optional><replaceable>ROOT</replaceable> <optional><replaceable>INIT</replaceable></optional></optional></term> |
b619ec8f LP |
1578 | |
1579 | <listitem> | |
b66a6e1a ZJS |
1580 | <para>Switches to a different root directory and executes a new system manager process below it. |
1581 | This is intended for use in the initrd, and will transition from the initrd's system manager | |
5ae89ef3 LP |
1582 | process (a.k.a. "init" process, PID 1) to the main system manager process which is loaded from |
1583 | the actual host root files system. This call takes two arguments: the directory that is to become | |
1584 | the new root directory, and the path to the new system manager binary below it to execute as PID | |
1585 | 1. If both are omitted or the former is an empty string it defaults to | |
1586 | <filename>/sysroot/</filename>. If the latter is omitted or is an empty string, a systemd binary | |
1587 | will automatically be searched for and used as service manager. If the system manager path is | |
1588 | omitted, equal to the empty string or identical to the path to the systemd binary, the state of | |
1589 | the initrd's system manager process is passed to the main system manager, which allows later | |
1590 | introspection of the state of the services involved in the initrd boot phase.</para> | |
b619ec8f LP |
1591 | </listitem> |
1592 | </varlistentry> | |
1593 | ||
1594 | <varlistentry> | |
e1fac8a6 | 1595 | <term><command>suspend</command></term> |
b619ec8f LP |
1596 | |
1597 | <listitem> | |
e1fac8a6 ZJS |
1598 | <para>Suspend the system. This will trigger activation of the special target unit |
1599 | <filename>suspend.target</filename>. This command is asynchronous, and will return after the suspend | |
1600 | operation is successfully enqueued. It will not wait for the suspend/resume cycle to complete.</para> | |
1601 | </listitem> | |
1602 | </varlistentry> | |
39207373 | 1603 | |
e1fac8a6 ZJS |
1604 | <varlistentry> |
1605 | <term><command>hibernate</command></term> | |
b619ec8f | 1606 | |
e1fac8a6 ZJS |
1607 | <listitem> |
1608 | <para>Hibernate the system. This will trigger activation of the special target unit | |
1609 | <filename>hibernate.target</filename>. This command is asynchronous, and will return after the hibernation | |
1610 | operation is successfully enqueued. It will not wait for the hibernate/thaw cycle to complete.</para> | |
b619ec8f LP |
1611 | </listitem> |
1612 | </varlistentry> | |
1613 | ||
1614 | <varlistentry> | |
e1fac8a6 | 1615 | <term><command>hybrid-sleep</command></term> |
b619ec8f LP |
1616 | |
1617 | <listitem> | |
e1fac8a6 ZJS |
1618 | <para>Hibernate and suspend the system. This will trigger activation of the special target unit |
1619 | <filename>hybrid-sleep.target</filename>. This command is asynchronous, and will return after the hybrid | |
1620 | sleep operation is successfully enqueued. It will not wait for the sleep/wake-up cycle to complete.</para> | |
b619ec8f LP |
1621 | </listitem> |
1622 | </varlistentry> | |
1623 | ||
27722f96 | 1624 | <varlistentry> |
e1fac8a6 | 1625 | <term><command>suspend-then-hibernate</command></term> |
27722f96 LN |
1626 | |
1627 | <listitem> | |
e1fac8a6 ZJS |
1628 | <para>Suspend the system and hibernate it after the delay specified in <filename>systemd-sleep.conf</filename>. |
1629 | This will trigger activation of the special target unit <filename>suspend-then-hibernate.target</filename>. | |
1630 | This command is asynchronous, and will return after the hybrid sleep operation is successfully enqueued. | |
1631 | It will not wait for the sleep/wake-up or hibernate/thaw cycle to complete.</para> | |
1632 | </listitem> | |
1633 | </varlistentry> | |
1634 | </variablelist> | |
1635 | </refsect2> | |
171754aa | 1636 | |
e1fac8a6 ZJS |
1637 | <refsect2> |
1638 | <title>Parameter Syntax</title> | |
171754aa | 1639 | |
e1fac8a6 ZJS |
1640 | <para>Unit commands listed above take either a single unit name (designated as <replaceable>UNIT</replaceable>), |
1641 | or multiple unit specifications (designated as <replaceable>PATTERN</replaceable>…). In the first case, the | |
1642 | unit name with or without a suffix must be given. If the suffix is not specified (unit name is "abbreviated"), | |
1643 | systemctl will append a suitable suffix, <literal>.service</literal> by default, and a type-specific suffix in | |
1644 | case of commands which operate only on specific unit types. For example, | |
1645 | <programlisting># systemctl start sshd</programlisting> and | |
1646 | <programlisting># systemctl start sshd.service</programlisting> | |
1647 | are equivalent, as are | |
1648 | <programlisting># systemctl isolate default</programlisting> | |
1649 | and | |
1650 | <programlisting># systemctl isolate default.target</programlisting> | |
1651 | Note that (absolute) paths to device nodes are automatically converted to device unit names, and other (absolute) | |
1652 | paths to mount unit names. | |
1653 | <programlisting># systemctl status /dev/sda | |
1654 | # systemctl status /home</programlisting> | |
1655 | are equivalent to: | |
1656 | <programlisting># systemctl status dev-sda.device | |
1657 | # systemctl status home.mount</programlisting> | |
1658 | In the second case, shell-style globs will be matched against the primary names of all units currently in memory; | |
1659 | literal unit names, with or without a suffix, will be treated as in the first case. This means that literal unit | |
1660 | names always refer to exactly one unit, but globs may match zero units and this is not considered an | |
1661 | error.</para> | |
171754aa | 1662 | |
e1fac8a6 ZJS |
1663 | <para>Glob patterns use |
1664 | <citerefentry project='man-pages'><refentrytitle>fnmatch</refentrytitle><manvolnum>3</manvolnum></citerefentry>, | |
1665 | so normal shell-style globbing rules are used, and | |
1666 | <literal>*</literal>, <literal>?</literal>, | |
1667 | <literal>[]</literal> may be used. See | |
1668 | <citerefentry project='man-pages'><refentrytitle>glob</refentrytitle><manvolnum>7</manvolnum></citerefentry> | |
1669 | for more details. The patterns are matched against the primary names of | |
1670 | units currently in memory, and patterns which do not match anything | |
1671 | are silently skipped. For example: | |
1672 | <programlisting># systemctl stop sshd@*.service</programlisting> | |
1673 | will stop all <filename>sshd@.service</filename> instances. Note that alias names of units, and units that aren't | |
1674 | in memory are not considered for glob expansion. | |
1675 | </para> | |
27722f96 | 1676 | |
e1fac8a6 ZJS |
1677 | <para>For unit file commands, the specified <replaceable>UNIT</replaceable> should be the name of the unit file |
1678 | (possibly abbreviated, see above), or the absolute path to the unit file: | |
1679 | <programlisting># systemctl enable foo.service</programlisting> | |
1680 | or | |
1681 | <programlisting># systemctl link /path/to/foo.service</programlisting> | |
1682 | </para> | |
1683 | </refsect2> | |
27722f96 | 1684 | |
e1fac8a6 | 1685 | </refsect1> |
27722f96 | 1686 | |
e1fac8a6 ZJS |
1687 | <refsect1> |
1688 | <title>Options</title> | |
27722f96 | 1689 | |
e1fac8a6 | 1690 | <para>The following options are understood:</para> |
27722f96 | 1691 | |
e1fac8a6 ZJS |
1692 | <variablelist> |
1693 | <varlistentry> | |
1694 | <term><option>-t</option></term> | |
1695 | <term><option>--type=</option></term> | |
27722f96 | 1696 | |
e1fac8a6 | 1697 | <listitem> |
a6e33464 ZJS |
1698 | <para>The argument is a comma-separated list of unit types such as <option>service</option> and |
1699 | <option>socket</option>. When units are listed with <command>list-units</command>, | |
37299769 MY |
1700 | <command>list-dependencies</command>, <command>show</command>, or <command>status</command>, |
1701 | only units of the specified types will be shown. By default, units of all types are shown.</para> | |
344ca755 | 1702 | |
a6e33464 ZJS |
1703 | <para>As a special case, if one of the arguments is <option>help</option>, a list of allowed values |
1704 | will be printed and the program will exit.</para> | |
e1fac8a6 ZJS |
1705 | </listitem> |
1706 | </varlistentry> | |
344ca755 | 1707 | |
e1fac8a6 ZJS |
1708 | <varlistentry> |
1709 | <term><option>--state=</option></term> | |
344ca755 | 1710 | |
e1fac8a6 | 1711 | <listitem> |
a6e33464 | 1712 | <para>The argument is a comma-separated list of unit LOAD, SUB, or ACTIVE states. When listing |
37299769 MY |
1713 | units with <command>list-units</command>, <command>list-dependencies</command>, <command>show</command> |
1714 | or <command>status</command>, show only those in the specified states. Use <option>--state=failed</option> | |
1715 | or <option>--failed</option> to show only failed units.</para> | |
a6e33464 ZJS |
1716 | |
1717 | <para>As a special case, if one of the arguments is <option>help</option>, a list of allowed values | |
1718 | will be printed and the program will exit.</para> | |
e1fac8a6 ZJS |
1719 | </listitem> |
1720 | </varlistentry> | |
27722f96 | 1721 | |
e1fac8a6 ZJS |
1722 | <varlistentry> |
1723 | <term><option>-p</option></term> | |
1724 | <term><option>--property=</option></term> | |
27722f96 | 1725 | |
e1fac8a6 ZJS |
1726 | <listitem> |
1727 | <para>When showing unit/job/manager properties with the | |
1728 | <command>show</command> command, limit display to properties | |
1729 | specified in the argument. The argument should be a | |
1730 | comma-separated list of property names, such as | |
1731 | <literal>MainPID</literal>. Unless specified, all known | |
1732 | properties are shown. If specified more than once, all | |
1733 | properties with the specified names are shown. Shell | |
1734 | completion is implemented for property names.</para> | |
7d4fb3b1 | 1735 | |
e1fac8a6 | 1736 | <para>For the manager itself, |
c809e387 PN |
1737 | <command>systemctl show</command> |
1738 | will show all available properties, most of which are derived or closely match the options described in | |
e1fac8a6 ZJS |
1739 | <citerefentry><refentrytitle>systemd-system.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>. |
1740 | </para> | |
7d4fb3b1 | 1741 | |
e1fac8a6 ZJS |
1742 | <para>Properties for units vary by unit type, so showing any |
1743 | unit (even a non-existent one) is a way to list properties | |
1744 | pertaining to this type. Similarly, showing any job will list | |
1745 | properties pertaining to all jobs. Properties for units are | |
1746 | documented in | |
1747 | <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>, | |
1748 | and the pages for individual unit types | |
1749 | <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>, | |
1750 | <citerefentry><refentrytitle>systemd.socket</refentrytitle><manvolnum>5</manvolnum></citerefentry>, | |
1751 | etc.</para> | |
1752 | </listitem> | |
1753 | </varlistentry> | |
7d4fb3b1 | 1754 | |
5292c240 ZJS |
1755 | <varlistentry> |
1756 | <term><option>-P</option></term> | |
1757 | ||
1758 | <listitem> | |
1759 | <para>Equivalent to <option>--value</option> <option>--property=</option>, i.e. shows the | |
1760 | value of the property without the property name or <literal>=</literal>. Note that using | |
1761 | <option>-P</option> once will also affect all properties listed with | |
1762 | <option>-p</option>/<option>--property=</option>.</para> | |
1763 | </listitem> | |
1764 | </varlistentry> | |
1765 | ||
e1fac8a6 ZJS |
1766 | <varlistentry> |
1767 | <term><option>-a</option></term> | |
1768 | <term><option>--all</option></term> | |
7d4fb3b1 | 1769 | |
e1fac8a6 ZJS |
1770 | <listitem> |
1771 | <para>When listing units with <command>list-units</command>, also show inactive units and | |
1772 | units which are following other units. When showing unit/job/manager properties, show all | |
1773 | properties regardless whether they are set or not.</para> | |
7d4fb3b1 | 1774 | |
e1fac8a6 ZJS |
1775 | <para>To list all units installed in the file system, use the |
1776 | <command>list-unit-files</command> command instead.</para> | |
39c38ce1 | 1777 | |
e1fac8a6 ZJS |
1778 | <para>When listing units with <command>list-dependencies</command>, recursively show |
1779 | dependencies of all dependent units (by default only dependencies of target units are | |
1780 | shown).</para> | |
7d4fb3b1 | 1781 | |
e1fac8a6 ZJS |
1782 | <para>When used with <command>status</command>, show journal messages in full, even if they include |
1783 | unprintable characters or are very long. By default, fields with unprintable characters are | |
1784 | abbreviated as "blob data". (Note that the pager may escape unprintable characters again.)</para> | |
1785 | </listitem> | |
1786 | </varlistentry> | |
7d4fb3b1 | 1787 | |
e1fac8a6 ZJS |
1788 | <varlistentry> |
1789 | <term><option>-r</option></term> | |
1790 | <term><option>--recursive</option></term> | |
7d4fb3b1 | 1791 | |
e1fac8a6 ZJS |
1792 | <listitem> |
1793 | <para>When listing units, also show units of local | |
1794 | containers. Units of local containers will be prefixed with | |
1795 | the container name, separated by a single colon character | |
1796 | (<literal>:</literal>).</para> | |
1797 | </listitem> | |
1798 | </varlistentry> | |
b619ec8f | 1799 | |
e1fac8a6 ZJS |
1800 | <varlistentry> |
1801 | <term><option>--reverse</option></term> | |
b619ec8f | 1802 | |
e1fac8a6 ZJS |
1803 | <listitem> |
1804 | <para>Show reverse dependencies between units with | |
1805 | <command>list-dependencies</command>, i.e. follow | |
1806 | dependencies of type <varname>WantedBy=</varname>, | |
38f90179 | 1807 | <varname>RequiredBy=</varname>, <varname>UpheldBy=</varname>, |
e1fac8a6 ZJS |
1808 | <varname>PartOf=</varname>, <varname>BoundBy=</varname>, |
1809 | instead of <varname>Wants=</varname> and similar. | |
1810 | </para> | |
1811 | </listitem> | |
1812 | </varlistentry> | |
b619ec8f | 1813 | |
e1fac8a6 ZJS |
1814 | <varlistentry> |
1815 | <term><option>--after</option></term> | |
b619ec8f | 1816 | |
e1fac8a6 ZJS |
1817 | <listitem> |
1818 | <para>With <command>list-dependencies</command>, show the | |
1819 | units that are ordered before the specified unit. In other | |
1820 | words, recursively list units following the | |
1821 | <varname>After=</varname> dependency.</para> | |
b619ec8f | 1822 | |
e1fac8a6 ZJS |
1823 | <para>Note that any <varname>After=</varname> dependency is |
1824 | automatically mirrored to create a | |
1825 | <varname>Before=</varname> dependency. Temporal dependencies | |
1826 | may be specified explicitly, but are also created implicitly | |
1827 | for units which are <varname>WantedBy=</varname> targets | |
1828 | (see | |
1829 | <citerefentry><refentrytitle>systemd.target</refentrytitle><manvolnum>5</manvolnum></citerefentry>), | |
1830 | and as a result of other directives (for example | |
1831 | <varname>RequiresMountsFor=</varname>). Both explicitly | |
1832 | and implicitly introduced dependencies are shown with | |
1833 | <command>list-dependencies</command>.</para> | |
27722f96 | 1834 | |
e1fac8a6 ZJS |
1835 | <para>When passed to the <command>list-jobs</command> command, for each printed job show which other jobs are |
1836 | waiting for it. May be combined with <option>--before</option> to show both the jobs waiting for each job as | |
1837 | well as all jobs each job is waiting for.</para> | |
1838 | </listitem> | |
1839 | </varlistentry> | |
0d292f5e | 1840 | |
e1fac8a6 ZJS |
1841 | <varlistentry> |
1842 | <term><option>--before</option></term> | |
0d292f5e | 1843 | |
e1fac8a6 ZJS |
1844 | <listitem> |
1845 | <para>With <command>list-dependencies</command>, show the | |
1846 | units that are ordered after the specified unit. In other | |
1847 | words, recursively list units following the | |
1848 | <varname>Before=</varname> dependency.</para> | |
0d292f5e | 1849 | |
e1fac8a6 ZJS |
1850 | <para>When passed to the <command>list-jobs</command> command, for each printed job show which other jobs it |
1851 | is waiting for. May be combined with <option>--after</option> to show both the jobs waiting for each job as | |
1852 | well as all jobs each job is waiting for.</para> | |
1853 | </listitem> | |
1854 | </varlistentry> | |
27722f96 | 1855 | |
a602a0b4 KK |
1856 | <varlistentry> |
1857 | <term><option>--with-dependencies</option></term> | |
1858 | ||
1859 | <listitem> | |
1860 | <para>When used with <command>status</command>, | |
1861 | <command>cat</command>, <command>list-units</command>, and | |
1862 | <command>list-unit-files</command>, those commands print all | |
1863 | specified units and the dependencies of those units.</para> | |
1864 | ||
1865 | <para>Options <option>--reverse</option>, | |
1866 | <option>--after</option>, <option>--before</option> | |
1867 | may be used to change what types of dependencies | |
1868 | are shown.</para> | |
1869 | </listitem> | |
1870 | </varlistentry> | |
1871 | ||
e1fac8a6 ZJS |
1872 | <varlistentry> |
1873 | <term><option>-l</option></term> | |
1874 | <term><option>--full</option></term> | |
27722f96 | 1875 | |
e1fac8a6 ZJS |
1876 | <listitem> |
1877 | <para>Do not ellipsize unit names, process tree entries, | |
1878 | journal output, or truncate unit descriptions in the output | |
1879 | of <command>status</command>, <command>list-units</command>, | |
1880 | <command>list-jobs</command>, and | |
1881 | <command>list-timers</command>.</para> | |
1882 | <para>Also, show installation targets in the output of | |
1883 | <command>is-enabled</command>.</para> | |
1884 | </listitem> | |
1885 | </varlistentry> | |
82948f6c | 1886 | |
e1fac8a6 ZJS |
1887 | <varlistentry> |
1888 | <term><option>--value</option></term> | |
27722f96 | 1889 | |
e1fac8a6 | 1890 | <listitem> |
5292c240 ZJS |
1891 | <para>When printing properties with <command>show</command>, only print the value, and skip the |
1892 | property name and <literal>=</literal>. Also see option <option>-P</option> above.</para> | |
e1fac8a6 ZJS |
1893 | </listitem> |
1894 | </varlistentry> | |
27722f96 | 1895 | |
e1fac8a6 ZJS |
1896 | <varlistentry> |
1897 | <term><option>--show-types</option></term> | |
27722f96 | 1898 | |
e1fac8a6 ZJS |
1899 | <listitem> |
1900 | <para>When showing sockets, show the type of the socket.</para> | |
1901 | </listitem> | |
1902 | </varlistentry> | |
27722f96 | 1903 | |
e1fac8a6 ZJS |
1904 | <varlistentry> |
1905 | <term><option>--job-mode=</option></term> | |
27722f96 | 1906 | |
e1fac8a6 ZJS |
1907 | <listitem> |
1908 | <para>When queuing a new job, this option controls how to deal with | |
1909 | already queued jobs. It takes one of <literal>fail</literal>, | |
1910 | <literal>replace</literal>, | |
1911 | <literal>replace-irreversibly</literal>, | |
1912 | <literal>isolate</literal>, | |
1913 | <literal>ignore-dependencies</literal>, | |
132e0b53 KK |
1914 | <literal>ignore-requirements</literal>, |
1915 | <literal>flush</literal>, or | |
1916 | <literal>triggering</literal>. Defaults to | |
e1fac8a6 ZJS |
1917 | <literal>replace</literal>, except when the |
1918 | <command>isolate</command> command is used which implies the | |
1919 | <literal>isolate</literal> job mode.</para> | |
27722f96 | 1920 | |
e1fac8a6 ZJS |
1921 | <para>If <literal>fail</literal> is specified and a requested |
1922 | operation conflicts with a pending job (more specifically: | |
1923 | causes an already pending start job to be reversed into a stop | |
1924 | job or vice versa), cause the operation to fail.</para> | |
ac3efa8a | 1925 | |
e1fac8a6 ZJS |
1926 | <para>If <literal>replace</literal> (the default) is |
1927 | specified, any conflicting pending job will be replaced, as | |
1928 | necessary.</para> | |
27722f96 | 1929 | |
e1fac8a6 ZJS |
1930 | <para>If <literal>replace-irreversibly</literal> is specified, |
1931 | operate like <literal>replace</literal>, but also mark the new | |
1932 | jobs as irreversible. This prevents future conflicting | |
1933 | transactions from replacing these jobs (or even being enqueued | |
1934 | while the irreversible jobs are still pending). Irreversible | |
1935 | jobs can still be cancelled using the <command>cancel</command> | |
1936 | command. This job mode should be used on any transaction which | |
1937 | pulls in <filename>shutdown.target</filename>.</para> | |
27722f96 | 1938 | |
e1fac8a6 ZJS |
1939 | <para><literal>isolate</literal> is only valid for start |
1940 | operations and causes all other units to be stopped when the | |
1941 | specified unit is started. This mode is always used when the | |
1942 | <command>isolate</command> command is used.</para> | |
27722f96 | 1943 | |
e1fac8a6 ZJS |
1944 | <para><literal>flush</literal> will cause all queued jobs to |
1945 | be canceled when the new job is enqueued.</para> | |
432d5965 | 1946 | |
e1fac8a6 ZJS |
1947 | <para>If <literal>ignore-dependencies</literal> is specified, |
1948 | then all unit dependencies are ignored for this new job and | |
1949 | the operation is executed immediately. If passed, no required | |
1950 | units of the unit passed will be pulled in, and no ordering | |
1951 | dependencies will be honored. This is mostly a debugging and | |
1952 | rescue tool for the administrator and should not be used by | |
1953 | applications.</para> | |
27722f96 | 1954 | |
e1fac8a6 ZJS |
1955 | <para><literal>ignore-requirements</literal> is similar to |
1956 | <literal>ignore-dependencies</literal>, but only causes the | |
1957 | requirement dependencies to be ignored, the ordering | |
1958 | dependencies will still be honored.</para> | |
1959 | </listitem> | |
27722f96 | 1960 | |
132e0b53 KK |
1961 | <para><literal>triggering</literal> may only be used with |
1962 | <command>systemctl stop</command>. In this mode, the specified | |
1963 | unit and any active units that trigger it are stopped. See the | |
1964 | discussion of | |
1965 | <varname>Triggers=</varname> in <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry> | |
1966 | for more information about triggering units.</para> | |
1967 | ||
e1fac8a6 | 1968 | </varlistentry> |
27722f96 | 1969 | |
e1fac8a6 ZJS |
1970 | <varlistentry> |
1971 | <term><option>-T</option></term> | |
1972 | <term><option>--show-transaction</option></term> | |
99813a19 | 1973 | |
e1fac8a6 ZJS |
1974 | <listitem> |
1975 | <para>When enqueuing a unit job (for example as effect of a <command>systemctl start</command> | |
1976 | invocation or similar), show brief information about all jobs enqueued, covering both the requested | |
1977 | job and any added because of unit dependencies. Note that the output will only include jobs | |
1978 | immediately part of the transaction requested. It is possible that service start-up program code | |
1979 | run as effect of the enqueued jobs might request further jobs to be pulled in. This means that | |
1980 | completion of the listed jobs might ultimately entail more jobs than the listed ones.</para> | |
1981 | </listitem> | |
1982 | </varlistentry> | |
2de51fdc | 1983 | |
e1fac8a6 ZJS |
1984 | <varlistentry> |
1985 | <term><option>--fail</option></term> | |
adb6cd9b | 1986 | |
e1fac8a6 ZJS |
1987 | <listitem> |
1988 | <para>Shorthand for <option>--job-mode=</option>fail.</para> | |
1989 | <para>When used with the <command>kill</command> command, | |
1990 | if no units were killed, the operation results in an error. | |
1991 | </para> | |
1992 | </listitem> | |
1993 | </varlistentry> | |
99813a19 | 1994 | |
4327574f FS |
1995 | <varlistentry> |
1996 | <term><option>--check-inhibitors=</option></term> | |
1997 | ||
1998 | <listitem> | |
5b69a7c5 ZJS |
1999 | <para>When system shutdown or sleep state is requested, this option controls checking of inhibitor |
2000 | locks. It takes one of <literal>auto</literal>, <literal>yes</literal> or | |
4327574f | 2001 | <literal>no</literal>. Defaults to <literal>auto</literal>, which will behave like |
5b69a7c5 ZJS |
2002 | <literal>yes</literal> for interactive invocations (i.e. from a TTY) and <literal>no</literal> for |
2003 | non-interactive invocations. <literal>yes</literal> lets the request respect inhibitor locks. | |
2004 | <literal>no</literal> lets the request ignore inhibitor locks.</para> | |
2005 | ||
2006 | <para>Applications can establish inhibitor locks to prevent certain important operations (such as | |
2007 | CD burning) from being interrupted by system shutdown or sleep. Any user may take these locks and | |
2008 | privileged users may override these locks. If any locks are taken, shutdown and sleep state | |
2009 | requests will normally fail (unless privileged). However, if <literal>no</literal> is specified or | |
2010 | <literal>auto</literal> is specified on a non-interactive requests, the operation will be | |
2011 | attempted. If locks are present, the operation may require additional privileges.</para> | |
2012 | ||
2013 | <para>Option <option>--force</option> provides another way to override inhibitors.</para> | |
4327574f FS |
2014 | </listitem> |
2015 | </varlistentry> | |
2016 | ||
e1fac8a6 ZJS |
2017 | <varlistentry> |
2018 | <term><option>-i</option></term> | |
27722f96 | 2019 | |
e1fac8a6 | 2020 | <listitem> |
4327574f | 2021 | <para>Shortcut for <option>--check-inhibitors=no</option>.</para> |
e1fac8a6 ZJS |
2022 | </listitem> |
2023 | </varlistentry> | |
99813a19 | 2024 | |
e1fac8a6 ZJS |
2025 | <varlistentry> |
2026 | <term><option>--dry-run</option></term> | |
27722f96 | 2027 | |
e1fac8a6 ZJS |
2028 | <listitem> |
2029 | <para>Just print what would be done. Currently supported by verbs | |
2030 | <command>halt</command>, <command>poweroff</command>, <command>reboot</command>, | |
2031 | <command>kexec</command>, <command>suspend</command>, <command>hibernate</command>, | |
2032 | <command>hybrid-sleep</command>, <command>suspend-then-hibernate</command>, | |
2033 | <command>default</command>, <command>rescue</command>, | |
2034 | <command>emergency</command>, and <command>exit</command>.</para> | |
2035 | </listitem> | |
2036 | </varlistentry> | |
27722f96 | 2037 | |
e1fac8a6 ZJS |
2038 | <varlistentry> |
2039 | <term><option>-q</option></term> | |
2040 | <term><option>--quiet</option></term> | |
27722f96 | 2041 | |
e1fac8a6 ZJS |
2042 | <listitem> |
2043 | <para>Suppress printing of the results of various commands | |
2044 | and also the hints about truncated log lines. This does not | |
2045 | suppress output of commands for which the printed output is | |
2046 | the only result (like <command>show</command>). Errors are | |
2047 | always printed.</para> | |
2048 | </listitem> | |
2049 | </varlistentry> | |
6324a8a7 | 2050 | |
108d35ac MY |
2051 | <varlistentry> |
2052 | <term><option>--no-warn</option></term> | |
2053 | ||
2054 | <listitem> | |
91dfb74e YW |
2055 | <para>Don't generate the warnings shown by default in the following cases: |
2056 | <itemizedlist> | |
2057 | <listitem> | |
2058 | <para>when <command>systemctl</command> is invoked without procfs mounted on | |
2059 | <filename>/proc/</filename>,</para> | |
2060 | </listitem> | |
2061 | <listitem> | |
2062 | <para>when using <command>enable</command> or <command>disable</command> on units without | |
e774d3c9 MY |
2063 | install information (i.e. don't have or have an empty [Install] section),</para> |
2064 | </listitem> | |
2065 | <listitem> | |
2066 | <para>when using <command>disable</command> combined with <option>--user</option> on units | |
2067 | that are enabled in global scope.</para> | |
91dfb74e YW |
2068 | </listitem> |
2069 | </itemizedlist> | |
2070 | </para> | |
108d35ac MY |
2071 | </listitem> |
2072 | </varlistentry> | |
2073 | ||
e1fac8a6 ZJS |
2074 | <varlistentry> |
2075 | <term><option>--no-block</option></term> | |
27722f96 | 2076 | |
e1fac8a6 ZJS |
2077 | <listitem> |
2078 | <para>Do not synchronously wait for the requested operation | |
2079 | to finish. If this is not specified, the job will be | |
2080 | verified, enqueued and <command>systemctl</command> will | |
2081 | wait until the unit's start-up is completed. By passing this | |
2082 | argument, it is only verified and enqueued. This option may not be | |
2083 | combined with <option>--wait</option>.</para> | |
2084 | </listitem> | |
2085 | </varlistentry> | |
6324a8a7 | 2086 | |
e1fac8a6 ZJS |
2087 | <varlistentry> |
2088 | <term><option>--wait</option></term> | |
2089 | ||
2090 | <listitem> | |
2091 | <para>Synchronously wait for started units to terminate again. | |
2092 | This option may not be combined with <option>--no-block</option>. | |
2093 | Note that this will wait forever if any given unit never terminates | |
2094 | (by itself or by getting stopped explicitly); particularly services | |
2095 | which use <literal>RemainAfterExit=yes</literal>.</para> | |
2096 | ||
2097 | <para>When used with <command>is-system-running</command>, wait | |
2098 | until the boot process is completed before returning.</para> | |
2099 | </listitem> | |
2100 | </varlistentry> | |
2101 | ||
2102 | <xi:include href="user-system-options.xml" xpointer="user" /> | |
2103 | <xi:include href="user-system-options.xml" xpointer="system" /> | |
2104 | ||
2105 | <varlistentry> | |
2106 | <term><option>--failed</option></term> | |
2107 | ||
2108 | <listitem> | |
2109 | <para>List units in failed state. This is equivalent to | |
2110 | <option>--state=failed</option>.</para> | |
2111 | </listitem> | |
2112 | </varlistentry> | |
2113 | ||
2114 | <varlistentry> | |
2115 | <term><option>--no-wall</option></term> | |
2116 | ||
2117 | <listitem> | |
2118 | <para>Do not send wall message before halt, power-off and reboot.</para> | |
2119 | </listitem> | |
2120 | </varlistentry> | |
2121 | ||
2122 | <varlistentry> | |
2123 | <term><option>--global</option></term> | |
2124 | ||
2125 | <listitem> | |
2126 | <para>When used with <command>enable</command> and | |
2127 | <command>disable</command>, operate on the global user | |
2128 | configuration directory, thus enabling or disabling a unit | |
2129 | file globally for all future logins of all users.</para> | |
2130 | </listitem> | |
2131 | </varlistentry> | |
2132 | ||
2133 | <varlistentry> | |
2134 | <term><option>--no-reload</option></term> | |
2135 | ||
2136 | <listitem> | |
2137 | <para>When used with <command>enable</command> and | |
2138 | <command>disable</command>, do not implicitly reload daemon | |
2139 | configuration after executing the changes.</para> | |
2140 | </listitem> | |
2141 | </varlistentry> | |
2142 | ||
2143 | <varlistentry> | |
2144 | <term><option>--no-ask-password</option></term> | |
2145 | ||
2146 | <listitem> | |
2147 | <para>When used with <command>start</command> and related | |
2148 | commands, disables asking for passwords. Background services | |
2149 | may require input of a password or passphrase string, for | |
2150 | example to unlock system hard disks or cryptographic | |
2151 | certificates. Unless this option is specified and the | |
2152 | command is invoked from a terminal, | |
2153 | <command>systemctl</command> will query the user on the | |
2154 | terminal for the necessary secrets. Use this option to | |
2155 | switch this behavior off. In this case, the password must be | |
2156 | supplied by some other means (for example graphical password | |
2157 | agents) or the service might fail. This also disables | |
2158 | querying the user for authentication for privileged | |
2159 | operations.</para> | |
2160 | </listitem> | |
2161 | </varlistentry> | |
2162 | ||
2163 | <varlistentry> | |
4ccde410 | 2164 | <term><option>--kill-whom=</option></term> |
e1fac8a6 ZJS |
2165 | |
2166 | <listitem> | |
f4ff3e71 LP |
2167 | <para>When used with <command>kill</command>, choose which processes to send a UNIX process signal |
2168 | to. Must be one of <option>main</option>, <option>control</option> or <option>all</option> to | |
2169 | select whether to kill only the main process, the control process or all processes of the unit. The | |
2170 | main process of the unit is the one that defines the life-time of it. A control process of a unit | |
2171 | is one that is invoked by the manager to induce state changes of it. For example, all processes | |
2172 | started due to the <varname>ExecStartPre=</varname>, <varname>ExecStop=</varname> or | |
2173 | <varname>ExecReload=</varname> settings of service units are control processes. Note that there is | |
2174 | only one control process per unit at a time, as only one state change is executed at a time. For | |
2175 | services of type <varname>Type=forking</varname>, the initial process started by the manager for | |
2176 | <varname>ExecStart=</varname> is a control process, while the process ultimately forked off by that | |
2177 | one is then considered the main process of the unit (if it can be determined). This is different | |
2178 | for service units of other types, where the process forked off by the manager for | |
2179 | <varname>ExecStart=</varname> is always the main process itself. A service unit consists of zero or | |
2180 | one main process, zero or one control process plus any number of additional processes. Not all unit | |
2181 | types manage processes of these types however. For example, for mount units, control processes are | |
2182 | defined (which are the invocations of <filename>&MOUNT_PATH;</filename> and | |
2183 | <filename>&UMOUNT_PATH;</filename>), but no main process is defined. If omitted, defaults to | |
e1fac8a6 ZJS |
2184 | <option>all</option>.</para> |
2185 | </listitem> | |
e1fac8a6 ZJS |
2186 | </varlistentry> |
2187 | ||
f4ff3e71 LP |
2188 | <varlistentry> |
2189 | <term><option>--kill-value=</option><replaceable>INT</replaceable></term> | |
2190 | ||
2191 | <listitem><para>If used with the <command>kill</command> command, enqueues a signal along with the | |
2192 | specified integer value parameter to the specified process(es). This operation is only available for | |
2193 | POSIX Realtime Signals (i.e. <option>--signal=SIGRTMIN+…</option> or | |
2194 | <option>--signal=SIGRTMAX-…</option>), and ensures the signals are generated via the <citerefentry | |
2195 | project='man-pages'><refentrytitle>sigqueue</refentrytitle><manvolnum>3</manvolnum></citerefentry> | |
2196 | system call, rather than <citerefentry | |
2197 | project='man-pages'><refentrytitle>kill</refentrytitle><manvolnum>3</manvolnum></citerefentry>. The | |
2198 | specified value must be a 32bit signed integer, and may be specified either in decimal, in | |
60c5bd77 | 2199 | hexadecimal (if prefixed with <literal>0x</literal>), octal (if prefixed with <literal>0o</literal>) |
f4ff3e71 LP |
2200 | or binary (if prefixed with <literal>0b</literal>)</para> |
2201 | ||
2202 | <para>If this option is used the signal will only be enqueued on the control or main process of the | |
2203 | unit, never on other processes belonging to the unit, i.e. <option>--kill-whom=all</option> will only | |
2204 | affect main and control processes but no other processes.</para></listitem> | |
2205 | </varlistentry> | |
2206 | ||
86beb213 | 2207 | <xi:include href="standard-options.xml" xpointer="signal" /> |
e1fac8a6 ZJS |
2208 | |
2209 | <varlistentry> | |
2210 | <term><option>--what=</option></term> | |
2211 | ||
2212 | <listitem> | |
2213 | <para>Select what type of per-unit resources to remove when the <command>clean</command> command is | |
4fb8f1e8 LP |
2214 | invoked, see above. Takes one of <constant>configuration</constant>, <constant>state</constant>, |
2215 | <constant>cache</constant>, <constant>logs</constant>, <constant>runtime</constant>, | |
2216 | <constant>fdstore</constant> to select the type of resource. This option may be specified more than | |
2217 | once, in which case all specified resource types are removed. Also accepts the special value | |
2218 | <constant>all</constant> as a shortcut for specifying all six resource types. If this option is not | |
2219 | specified defaults to the combination of <constant>cache</constant>, <constant>runtime</constant> | |
2220 | and <constant>fdstore</constant>, i.e. the three kinds of resources that are generally considered | |
2221 | to be redundant and can be reconstructed on next invocation. Note that the explicit removal of the | |
2222 | <constant>fdstore</constant> resource type is only useful if the | |
2223 | <varname>FileDescriptorStorePreserve=</varname> option is enabled, since the file descriptor store | |
2224 | is otherwise cleaned automatically when the unit is stopped.</para> | |
e1fac8a6 ZJS |
2225 | </listitem> |
2226 | </varlistentry> | |
2227 | ||
2228 | <varlistentry> | |
2229 | <term><option>-f</option></term> | |
2230 | <term><option>--force</option></term> | |
2231 | ||
2232 | <listitem> | |
2233 | <para>When used with <command>enable</command>, overwrite | |
2234 | any existing conflicting symlinks.</para> | |
2235 | ||
2236 | <para>When used with <command>edit</command>, create all of the | |
2237 | specified units which do not already exist.</para> | |
2238 | ||
2239 | <para>When used with <command>halt</command>, <command>poweroff</command>, <command>reboot</command> or | |
2240 | <command>kexec</command>, execute the selected operation without shutting down all units. However, all | |
2241 | processes will be killed forcibly and all file systems are unmounted or remounted read-only. This is hence a | |
2242 | drastic but relatively safe option to request an immediate reboot. If <option>--force</option> is specified | |
2243 | twice for these operations (with the exception of <command>kexec</command>), they will be executed | |
2244 | immediately, without terminating any processes or unmounting any file systems. Warning: specifying | |
2245 | <option>--force</option> twice with any of these operations might result in data loss. Note that when | |
2246 | <option>--force</option> is specified twice the selected operation is executed by | |
2247 | <command>systemctl</command> itself, and the system manager is not contacted. This means the command should | |
2248 | succeed even when the system manager has crashed.</para> | |
2249 | </listitem> | |
2250 | </varlistentry> | |
27722f96 | 2251 | |
e1fac8a6 ZJS |
2252 | <varlistentry> |
2253 | <term><option>--message=</option></term> | |
6324a8a7 | 2254 | |
e1fac8a6 ZJS |
2255 | <listitem> |
2256 | <para>When used with <command>halt</command>, <command>poweroff</command> or <command>reboot</command>, set a | |
2257 | short message explaining the reason for the operation. The message will be logged together with the default | |
2258 | shutdown message.</para> | |
2259 | </listitem> | |
2260 | </varlistentry> | |
6324a8a7 | 2261 | |
e1fac8a6 ZJS |
2262 | <varlistentry> |
2263 | <term><option>--now</option></term> | |
b619ec8f | 2264 | |
e1fac8a6 ZJS |
2265 | <listitem> |
2266 | <para>When used with <command>enable</command>, the units | |
2267 | will also be started. When used with <command>disable</command> or | |
2268 | <command>mask</command>, the units will also be stopped. The start | |
2269 | or stop operation is only carried out when the respective enable or | |
2270 | disable operation has been successful.</para> | |
2271 | </listitem> | |
2272 | </varlistentry> | |
27722f96 | 2273 | |
e1fac8a6 ZJS |
2274 | <varlistentry> |
2275 | <term><option>--root=</option></term> | |
6324a8a7 | 2276 | |
e1fac8a6 ZJS |
2277 | <listitem> |
2278 | <para>When used with | |
2279 | <command>enable</command>/<command>disable</command>/<command>is-enabled</command> | |
2280 | (and related commands), use the specified root path when looking for unit | |
2281 | files. If this option is present, <command>systemctl</command> will operate on | |
2282 | the file system directly, instead of communicating with the <command>systemd</command> | |
2283 | daemon to carry out changes.</para> | |
2284 | </listitem> | |
b619ec8f | 2285 | |
e1fac8a6 | 2286 | </varlistentry> |
27722f96 | 2287 | |
8aa3894e RP |
2288 | <varlistentry> |
2289 | <term><option>--image=<replaceable>image</replaceable></option></term> | |
2290 | ||
2291 | <listitem><para>Takes a path to a disk image file or block device node. If specified, all operations | |
2292 | are applied to file system in the indicated disk image. This option is similar to | |
2293 | <option>--root=</option>, but operates on file systems stored in disk images or block devices. The | |
2294 | disk image should either contain just a file system or a set of file systems within a GPT partition | |
db811444 | 2295 | table, following the <ulink url="https://uapi-group.org/specifications/specs/discoverable_partitions_specification">Discoverable Partitions |
8aa3894e RP |
2296 | Specification</ulink>. For further information on supported disk images, see |
2297 | <citerefentry><refentrytitle>systemd-nspawn</refentrytitle><manvolnum>1</manvolnum></citerefentry>'s | |
2298 | switch of the same name.</para></listitem> | |
2299 | </varlistentry> | |
2300 | ||
9ea81191 LP |
2301 | <xi:include href="standard-options.xml" xpointer="image-policy-open" /> |
2302 | ||
e1fac8a6 ZJS |
2303 | <varlistentry> |
2304 | <term><option>--runtime</option></term> | |
6324a8a7 | 2305 | |
e1fac8a6 ZJS |
2306 | <listitem> |
2307 | <para>When used with <command>enable</command>, | |
2308 | <command>disable</command>, <command>edit</command>, | |
2309 | (and related commands), make changes only temporarily, so | |
2310 | that they are lost on the next reboot. This will have the | |
2311 | effect that changes are not made in subdirectories of | |
3b121157 | 2312 | <filename>/etc/</filename> but in <filename>/run/</filename>, |
e1fac8a6 ZJS |
2313 | with identical immediate effects, however, since the latter |
2314 | is lost on reboot, the changes are lost too.</para> | |
27722f96 | 2315 | |
e1fac8a6 ZJS |
2316 | <para>Similarly, when used with |
2317 | <command>set-property</command>, make changes only | |
2318 | temporarily, so that they are lost on the next | |
2319 | reboot.</para> | |
2320 | </listitem> | |
2321 | </varlistentry> | |
b619ec8f | 2322 | |
e1fac8a6 ZJS |
2323 | <varlistentry> |
2324 | <term><option>--preset-mode=</option></term> | |
b619ec8f | 2325 | |
e1fac8a6 ZJS |
2326 | <listitem> |
2327 | <para>Takes one of <literal>full</literal> (the default), | |
2328 | <literal>enable-only</literal>, | |
2329 | <literal>disable-only</literal>. When used with the | |
2330 | <command>preset</command> or <command>preset-all</command> | |
2331 | commands, controls whether units shall be disabled and | |
2332 | enabled according to the preset rules, or only enabled, or | |
2333 | only disabled.</para> | |
2334 | </listitem> | |
2335 | </varlistentry> | |
27722f96 | 2336 | |
e1fac8a6 ZJS |
2337 | <varlistentry> |
2338 | <term><option>-n</option></term> | |
2339 | <term><option>--lines=</option></term> | |
b619ec8f | 2340 | |
e1fac8a6 | 2341 | <listitem> |
e04eae5e ZJS |
2342 | <para>When used with <command>status</command>, controls the number of journal lines to show, |
2343 | counting from the most recent ones. Takes a positive integer argument, or 0 to disable journal | |
2344 | output. Defaults to 10.</para> | |
e1fac8a6 ZJS |
2345 | </listitem> |
2346 | </varlistentry> | |
27722f96 | 2347 | |
e1fac8a6 ZJS |
2348 | <varlistentry> |
2349 | <term><option>-o</option></term> | |
2350 | <term><option>--output=</option></term> | |
b619ec8f | 2351 | |
e1fac8a6 ZJS |
2352 | <listitem> |
2353 | <para>When used with <command>status</command>, controls the | |
2354 | formatting of the journal entries that are shown. For the | |
2355 | available choices, see | |
2356 | <citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>. | |
2357 | Defaults to <literal>short</literal>.</para> | |
2358 | </listitem> | |
2359 | </varlistentry> | |
27722f96 | 2360 | |
e1fac8a6 ZJS |
2361 | <varlistentry> |
2362 | <term><option>--firmware-setup</option></term> | |
6cc2b882 | 2363 | |
e1fac8a6 | 2364 | <listitem> |
e04eae5e ZJS |
2365 | <para>When used with the <command>reboot</command> command, indicate to the system's firmware to |
2366 | reboot into the firmware setup interface. Note that this functionality is not available on all | |
2367 | systems.</para> | |
e1fac8a6 ZJS |
2368 | </listitem> |
2369 | </varlistentry> | |
6cc2b882 | 2370 | |
e1fac8a6 | 2371 | <varlistentry> |
76c068b7 | 2372 | <term><option>--boot-loader-menu=<replaceable>timeout</replaceable></option></term> |
4a6022f0 | 2373 | |
e1fac8a6 | 2374 | <listitem> |
e04eae5e ZJS |
2375 | <para>When used with the <command>reboot</command> command, indicate to the system's boot loader to |
2376 | show the boot loader menu on the following boot. Takes a time value as parameter — indicating the | |
2377 | menu timeout. Pass zero in order to disable the menu timeout. Note that not all boot loaders | |
2378 | support this functionality.</para> | |
e1fac8a6 ZJS |
2379 | </listitem> |
2380 | </varlistentry> | |
a7c0e5d7 | 2381 | |
e1fac8a6 | 2382 | <varlistentry> |
76c068b7 | 2383 | <term><option>--boot-loader-entry=<replaceable>ID</replaceable></option></term> |
e3e0314b | 2384 | |
e1fac8a6 | 2385 | <listitem> |
e04eae5e ZJS |
2386 | <para>When used with the <command>reboot</command> command, indicate to the system's boot loader to |
2387 | boot into a specific boot loader entry on the following boot. Takes a boot loader entry identifier | |
2388 | as argument, or <literal>help</literal> in order to list available entries. Note that not all boot | |
2389 | loaders support this functionality.</para> | |
e1fac8a6 ZJS |
2390 | </listitem> |
2391 | </varlistentry> | |
e3e0314b | 2392 | |
dae710be | 2393 | <varlistentry> |
2394 | <term><option>--reboot-argument=</option></term> | |
2395 | ||
2396 | <listitem> | |
2397 | <para>This switch is used with <command>reboot</command>. The value is architecture and firmware specific. As an example, <literal>recovery</literal> | |
2398 | might be used to trigger system recovery, and <literal>fota</literal> might be used to trigger a | |
2399 | <quote>firmware over the air</quote> update.</para> | |
2400 | </listitem> | |
2401 | </varlistentry> | |
2402 | ||
e1fac8a6 ZJS |
2403 | <varlistentry> |
2404 | <term><option>--plain</option></term> | |
a7c0e5d7 | 2405 | |
e1fac8a6 ZJS |
2406 | <listitem> |
2407 | <para>When used with <command>list-dependencies</command>, | |
2408 | <command>list-units</command> or <command>list-machines</command>, | |
2409 | the output is printed as a list instead of a tree, and the bullet | |
2410 | circles are omitted.</para> | |
2411 | </listitem> | |
2412 | </varlistentry> | |
46ad9c53 LB |
2413 | |
2414 | <varlistentry> | |
2415 | <term><option>--timestamp=</option></term> | |
2416 | ||
2417 | <listitem> | |
d13f2617 ZJS |
2418 | <para>Change the format of printed timestamps. The following values may be used: |
2419 | </para> | |
2420 | ||
2421 | <variablelist> | |
2422 | <varlistentry> | |
2423 | <term><option>pretty</option> (this is the default)</term> | |
2424 | <listitem><para><literal>Day YYYY-MM-DD HH:MM:SS TZ</literal></para></listitem> | |
2425 | </varlistentry> | |
2426 | </variablelist> | |
2427 | ||
b58b4a9f FS |
2428 | <variablelist> |
2429 | <varlistentry> | |
2430 | <term><option>unix</option></term> | |
2431 | <listitem><para><literal>@seconds-since-the-epoch</literal></para></listitem> | |
2432 | </varlistentry> | |
2433 | </variablelist> | |
2434 | ||
d13f2617 ZJS |
2435 | <variablelist> |
2436 | <varlistentry> | |
2437 | <term><option>us</option></term> | |
2438 | <term><option>µs</option></term> | |
2439 | <listitem><para><literal>Day YYYY-MM-DD HH:MM:SS.UUUUUU TZ</literal></para></listitem> | |
2440 | </varlistentry> | |
2441 | </variablelist> | |
2442 | ||
2443 | <variablelist> | |
2444 | <varlistentry> | |
2445 | <term><option>utc</option></term> | |
2446 | <listitem><para><literal>Day YYYY-MM-DD HH:MM:SS UTC</literal></para></listitem> | |
2447 | </varlistentry> | |
2448 | </variablelist> | |
2449 | ||
2450 | <variablelist> | |
2451 | <varlistentry> | |
2452 | <term><option>us+utc</option></term> | |
2453 | <term><option>µs+utc</option></term> | |
2454 | <listitem><para><literal>Day YYYY-MM-DD HH:MM:SS.UUUUUU UTC</literal></para></listitem> | |
2455 | </varlistentry> | |
2456 | </variablelist> | |
46ad9c53 LB |
2457 | </listitem> |
2458 | </varlistentry> | |
e1fac8a6 | 2459 | |
5e8deb94 LB |
2460 | <varlistentry> |
2461 | <term><option>--mkdir</option></term> | |
2462 | ||
2463 | <listitem><para>When used with <command>bind</command>, creates the destination file or directory before | |
2464 | applying the bind mount. Note that even though the name of this option suggests that it is suitable only for | |
2465 | directories, this option also creates the destination file node to mount over if the object to mount is not | |
2466 | a directory, but a regular file, device node, socket or FIFO.</para></listitem> | |
2467 | </varlistentry> | |
2468 | ||
c9615f73 ZJS |
2469 | <varlistentry> |
2470 | <term><option>--marked</option></term> | |
2471 | ||
2472 | <listitem><para>Only allowed with <command>reload-or-restart</command>. Enqueues restart jobs for all | |
2473 | units that have the <literal>needs-restart</literal> mark, and reload jobs for units that have the | |
2474 | <literal>needs-reload</literal> mark. When a unit marked for reload does not support reload, restart | |
1ca1bb03 | 2475 | will be queued. Those properties can be set using <command>set-property Markers=…</command>.</para> |
c9615f73 ZJS |
2476 | |
2477 | <para>Unless <option>--no-block</option> is used, <command>systemctl</command> will wait for the | |
2478 | queued jobs to finish.</para></listitem> | |
2479 | </varlistentry> | |
2480 | ||
5e8deb94 LB |
2481 | <varlistentry> |
2482 | <term><option>--read-only</option></term> | |
2483 | ||
2484 | <listitem><para>When used with <command>bind</command>, creates a read-only bind mount.</para></listitem> | |
2485 | </varlistentry> | |
2486 | ||
f206809b MY |
2487 | <varlistentry> |
2488 | <term><option>--drop-in=</option></term> | |
2489 | ||
2490 | <listitem> | |
2491 | <para>When used with <command>edit</command>, use the given drop-in file name instead of | |
2492 | <filename>override.conf</filename>.</para> | |
2493 | </listitem> | |
2494 | </varlistentry> | |
2495 | ||
1433e1f9 MY |
2496 | <varlistentry> |
2497 | <term><option>--when=</option></term> | |
2498 | ||
2499 | <listitem> | |
2500 | <para>When used with <command>halt</command>, <command>poweroff</command>, <command>reboot</command> | |
2501 | or <command>kexec</command>, schedule the action to be performed at the given timestamp, | |
2502 | which should adhere to the syntax documented in <citerefentry | |
2503 | project='man-pages'><refentrytitle>systemd.time</refentrytitle><manvolnum>7</manvolnum></citerefentry> | |
2504 | section "PARSING TIMESTAMPS". Specially, if <literal>show</literal> is given, the currently scheduled | |
2505 | action will be shown, which can be canceled by passing an empty string or <literal>cancel</literal>.</para> | |
2506 | </listitem> | |
2507 | </varlistentry> | |
2508 | ||
e1fac8a6 ZJS |
2509 | <xi:include href="user-system-options.xml" xpointer="host" /> |
2510 | <xi:include href="user-system-options.xml" xpointer="machine" /> | |
2511 | ||
2512 | <xi:include href="standard-options.xml" xpointer="no-pager" /> | |
6906da26 | 2513 | <xi:include href="standard-options.xml" xpointer="legend" /> |
e1fac8a6 ZJS |
2514 | <xi:include href="standard-options.xml" xpointer="help" /> |
2515 | <xi:include href="standard-options.xml" xpointer="version" /> | |
2516 | </variablelist> | |
4a6022f0 ZJS |
2517 | </refsect1> |
2518 | ||
2519 | <refsect1> | |
2520 | <title>Exit status</title> | |
2521 | ||
23a9ffb0 ZJS |
2522 | <para>On success, 0 is returned, a non-zero failure code otherwise.</para> |
2523 | ||
2524 | <para><command>systemctl</command> uses the return codes defined by LSB, as defined in | |
2525 | <ulink url="http://refspecs.linuxbase.org/LSB_3.0.0/LSB-PDA/LSB-PDA/iniscrptact.html">LSB 3.0.0</ulink>. | |
2526 | </para> | |
2527 | ||
2528 | <table> | |
2529 | <title>LSB return codes</title> | |
2530 | ||
2531 | <tgroup cols='3'> | |
2532 | <thead> | |
2533 | <row> | |
2534 | <entry>Value</entry> | |
2535 | <entry>Description in LSB</entry> | |
2536 | <entry>Use in systemd</entry> | |
2537 | </row> | |
2538 | </thead> | |
2539 | <tbody> | |
2540 | <row> | |
2541 | <entry><constant>0</constant></entry> | |
2542 | <entry>"program is running or service is OK"</entry> | |
2543 | <entry>unit is active</entry> | |
2544 | </row> | |
2545 | <row> | |
2546 | <entry><constant>1</constant></entry> | |
2547 | <entry>"program is dead and <filename>/var/run</filename> pid file exists"</entry> | |
2548 | <entry>unit <emphasis>not</emphasis> failed (used by <command>is-failed</command>)</entry> | |
2549 | </row> | |
2550 | <row> | |
2551 | <entry><constant>2</constant></entry> | |
2552 | <entry>"program is dead and <filename>/var/lock</filename> lock file exists"</entry> | |
2553 | <entry>unused</entry> | |
2554 | </row> | |
2555 | <row> | |
2556 | <entry><constant>3</constant></entry> | |
2557 | <entry>"program is not running"</entry> | |
2558 | <entry>unit is not active</entry> | |
2559 | </row> | |
2560 | <row> | |
2561 | <entry><constant>4</constant></entry> | |
2562 | <entry>"program or service status is unknown"</entry> | |
2563 | <entry>no such unit</entry> | |
2564 | </row> | |
2565 | </tbody> | |
2566 | </tgroup> | |
2567 | </table> | |
2568 | ||
2569 | <para>The mapping of LSB service states to systemd unit states is imperfect, so it is better to | |
2570 | not rely on those return values but to look for specific unit states and substates instead. | |
2571 | </para> | |
4a6022f0 ZJS |
2572 | </refsect1> |
2573 | ||
7d4fb3b1 RC |
2574 | <refsect1> |
2575 | <title>Environment</title> | |
2576 | ||
2577 | <variablelist class='environment-variables'> | |
2578 | <varlistentry> | |
2579 | <term><varname>$SYSTEMD_EDITOR</varname></term> | |
2580 | ||
2581 | <listitem><para>Editor to use when editing units; overrides | |
2582 | <varname>$EDITOR</varname> and <varname>$VISUAL</varname>. If neither | |
2583 | <varname>$SYSTEMD_EDITOR</varname> nor <varname>$EDITOR</varname> nor | |
2584 | <varname>$VISUAL</varname> are present or if it is set to an empty | |
2585 | string or if their execution failed, systemctl will try to execute well | |
2586 | known editors in this order: | |
9391a1c3 | 2587 | <citerefentry project='die-net'><refentrytitle>editor</refentrytitle><manvolnum>1</manvolnum></citerefentry>, |
3ba3a79d ZJS |
2588 | <citerefentry project='die-net'><refentrytitle>nano</refentrytitle><manvolnum>1</manvolnum></citerefentry>, |
2589 | <citerefentry project='die-net'><refentrytitle>vim</refentrytitle><manvolnum>1</manvolnum></citerefentry>, | |
2590 | <citerefentry project='die-net'><refentrytitle>vi</refentrytitle><manvolnum>1</manvolnum></citerefentry>. | |
7d4fb3b1 RC |
2591 | </para></listitem> |
2592 | </varlistentry> | |
2593 | </variablelist> | |
5bd27a17 ZJS |
2594 | <xi:include href="common-variables.xml" xpointer="log-level"/> |
2595 | <xi:include href="common-variables.xml" xpointer="log-color"/> | |
2596 | <xi:include href="common-variables.xml" xpointer="log-time"/> | |
2597 | <xi:include href="common-variables.xml" xpointer="log-location"/> | |
2598 | <xi:include href="common-variables.xml" xpointer="log-target"/> | |
4ef3ca34 ZJS |
2599 | <xi:include href="common-variables.xml" xpointer="pager"/> |
2600 | <xi:include href="common-variables.xml" xpointer="less"/> | |
2601 | <xi:include href="common-variables.xml" xpointer="lesscharset"/> | |
2602 | <xi:include href="common-variables.xml" xpointer="lesssecure"/> | |
2603 | <xi:include href="common-variables.xml" xpointer="colors"/> | |
2604 | <xi:include href="common-variables.xml" xpointer="urlify"/> | |
7d4fb3b1 | 2605 | </refsect1> |
4a6022f0 ZJS |
2606 | |
2607 | <refsect1> | |
2608 | <title>See Also</title> | |
2609 | <para> | |
2610 | <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>, | |
4a6022f0 ZJS |
2611 | <citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>, |
2612 | <citerefentry><refentrytitle>loginctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>, | |
a03fe1a5 | 2613 | <citerefentry><refentrytitle>machinectl</refentrytitle><manvolnum>1</manvolnum></citerefentry>, |
4a6022f0 | 2614 | <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>, |
ee41f602 | 2615 | <citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>, |
4a6022f0 | 2616 | <citerefentry><refentrytitle>systemd.special</refentrytitle><manvolnum>7</manvolnum></citerefentry>, |
5aded369 | 2617 | <citerefentry project='man-pages'><refentrytitle>wall</refentrytitle><manvolnum>1</manvolnum></citerefentry>, |
7d4fb3b1 | 2618 | <citerefentry><refentrytitle>systemd.preset</refentrytitle><manvolnum>5</manvolnum></citerefentry>, |
432d5965 | 2619 | <citerefentry><refentrytitle>systemd.generator</refentrytitle><manvolnum>7</manvolnum></citerefentry>, |
decde8cd | 2620 | <citerefentry project='man-pages'><refentrytitle>glob</refentrytitle><manvolnum>7</manvolnum></citerefentry> |
4a6022f0 ZJS |
2621 | </para> |
2622 | </refsect1> | |
7874bcd6 LP |
2623 | |
2624 | </refentry> |