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