1SYSTEMCTL(1) systemctl SYSTEMCTL(1)
2
3
4
6 systemctl - Control the systemd system and service manager
7
9 systemctl [OPTIONS...] COMMAND [UNIT...]
10
12 systemctl may be used to introspect and control the state of the
13 "systemd" system and service manager. Please refer to systemd(1) for an
14 introduction into the basic concepts and functionality this tool
15 manages.
16
18 The following commands are understood:
19
20 Unit Commands
21 list-units [PATTERN...]
22 List units that systemd currently has in memory. This includes
23 units that are either referenced directly or through a dependency,
24 units that are pinned by applications programmatically, or units
25 that were active in the past and have failed. By default only units
26 which are active, have pending jobs, or have failed are shown; this
27 can be changed with option --all. If one or more PATTERNs are
28 specified, only units matching one of them are shown. The units
29 that are shown are additionally filtered by --type= and --state= if
30 those options are specified.
31
32 Produces output similar to
33
34 UNIT LOAD ACTIVE SUB DESCRIPTION
35 sys-module-fuse.device loaded active plugged /sys/module/fuse
36 -.mount loaded active mounted Root Mount
37 boot-efi.mount loaded active mounted /boot/efi
38 systemd-journald.service loaded active running Journal Service
39 systemd-logind.service loaded active running Login Service
40 ● user@1000.service loaded failed failed User Manager for UID 1000
41 ...
42 systemd-tmpfiles-clean.timer loaded active waiting Daily Cleanup of Temporary Directories
43
44 LOAD = Reflects whether the unit definition was properly loaded.
45 ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
46 SUB = The low-level unit activation state, values depend on unit type.
47
48 123 loaded units listed. Pass --all to see loaded but inactive units, too.
49 To show all installed unit files use 'systemctl list-unit-files'.
50
51
52 The header and the last unit of a given type are underlined if the
53 terminal supports that. A colored dot is shown next to services
54 which were masked, not found, or otherwise failed.
55
56 The LOAD column shows the load state, one of loaded, not-found,
57 bad-setting, error, masked. The ACTIVE columns shows the general
58 unit state, one of active, reloading, inactive, failed, activating,
59 deactivating. The SUB column shows the unit-type-specific detailed
60 state of the unit, possible values vary by unit type. The list of
61 possible LOAD, ACTIVE, and SUB states is not constant and new
62 systemd releases may both add and remove values.
63
64 systemctl --state=help
65
66 command maybe be used to display the current set of possible
67 values.
68
69 This is the default command.
70
71 list-sockets [PATTERN...]
72 List socket units currently in memory, ordered by listening
73 address. If one or more PATTERNs are specified, only socket units
74 matching one of them are shown. Produces output similar to
75
76 LISTEN UNIT ACTIVATES
77 /dev/initctl systemd-initctl.socket systemd-initctl.service
78 ...
79 [::]:22 sshd.socket sshd.service
80 kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service
81
82 5 sockets listed.
83
84 Note: because the addresses might contains spaces, this output is
85 not suitable for programmatic consumption.
86
87 Also see --show-types, --all, and --state=.
88
89 list-timers [PATTERN...]
90 List timer units currently in memory, ordered by the time they
91 elapse next. If one or more PATTERNs are specified, only units
92 matching one of them are shown. Produces output similar to
93
94 NEXT LEFT LAST PASSED UNIT ACTIVATES
95 n/a n/a Thu 2017-02-23 13:40:29 EST 3 days ago ureadahead-stop.timer ureadahead-stop.service
96 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
97 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
98 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
99
100
101 NEXT shows the next time the timer will run.
102
103 LEFT shows how long till the next time the timer runs.
104
105 LAST shows the last time the timer ran.
106
107 PASSED shows how long has passed since the timer last ran.
108
109 UNIT shows the name of the timer
110
111 ACTIVATES shows the name the service the timer activates when it
112 runs.
113
114 Also see --all and --state=.
115
116 start PATTERN...
117 Start (activate) one or more units specified on the command line.
118
119 Note that unit glob patterns expand to names of units currently in
120 memory. Units which are not active and are not in a failed state
121 usually are not in memory, and will not be matched by any pattern.
122 In addition, in case of instantiated units, systemd is often
123 unaware of the instance name until the instance has been started.
124 Therefore, using glob patterns with start has limited usefulness.
125 Also, secondary alias names of units are not considered.
126
127 Option --all may be used to also operate on inactive units which
128 are referenced by other loaded units. Note that this is not the
129 same as operating on "all" possible units, because as the previous
130 paragraph describes, such a list is ill-defined. Nevertheless,
131 systemctl start --all GLOB may be useful if all the units that
132 should match the pattern are pulled in by some target which is
133 known to be loaded.
134
135 stop PATTERN...
136 Stop (deactivate) one or more units specified on the command line.
137
138 This command will fail if the unit does not exist or if stopping of
139 the unit is prohibited (see RefuseManualStop= in systemd.unit(5)).
140 It will not fail if any of the commands configured to stop the unit
141 (ExecStop=, etc.) fail, because the manager will still forcibly
142 terminate the unit.
143
144 reload PATTERN...
145 Asks all units listed on the command line to reload their
146 configuration. Note that this will reload the service-specific
147 configuration, not the unit configuration file of systemd. If you
148 want systemd to reload the configuration file of a unit, use the
149 daemon-reload command. In other words: for the example case of
150 Apache, this will reload Apache's httpd.conf in the web server, not
151 the apache.service systemd unit file.
152
153 This command should not be confused with the daemon-reload command.
154
155 restart PATTERN...
156 Stop and then start one or more units specified on the command
157 line. If the units are not running yet, they will be started.
158
159 Note that restarting a unit with this command does not necessarily
160 flush out all of the unit's resources before it is started again.
161 For example, the per-service file descriptor storage facility (see
162 FileDescriptorStoreMax= in systemd.service(5)) will remain intact
163 as long as the unit has a job pending, and is only cleared when the
164 unit is fully stopped and no jobs are pending anymore. If it is
165 intended that the file descriptor store is flushed out, too, during
166 a restart operation an explicit systemctl stop command followed by
167 systemctl start should be issued.
168
169 try-restart PATTERN...
170 Stop and then start one or more units specified on the command line
171 if the units are running. This does nothing if units are not
172 running.
173
174 reload-or-restart PATTERN...
175 Reload one or more units if they support it. If not, stop and then
176 start them instead. If the units are not running yet, they will be
177 started.
178
179 try-reload-or-restart PATTERN...
180 Reload one or more units if they support it. If not, stop and then
181 start them instead. This does nothing if the units are not running.
182
183 isolate UNIT
184 Start the unit specified on the command line and its dependencies
185 and stop all others, unless they have IgnoreOnIsolate=yes (see
186 systemd.unit(5)). If a unit name with no extension is given, an
187 extension of ".target" will be assumed.
188
189 This command is dangerous, since it will immediately stop processes
190 that are not enabled in the new target, possibly including the
191 graphical environment or terminal you are currently using.
192
193 Note that this is allowed only on units where AllowIsolate= is
194 enabled. See systemd.unit(5) for details.
195
196 kill PATTERN...
197 Send a signal to one or more processes of the unit. Use --kill-who=
198 to select which process to kill. Use --signal= to select the signal
199 to send.
200
201 clean PATTERN...
202 Remove the configuration, state, cache, logs or runtime data of the
203 specified units. Use --what= to select which kind of resource to
204 remove. For service units this may be used to remove the
205 directories configured with ConfigurationDirectory=,
206 StateDirectory=, CacheDirectory=, LogsDirectory= and
207 RuntimeDirectory=, see systemd.exec(5) for details. For timer units
208 this may be used to clear out the persistent timestamp data if
209 Persistent= is used and --what=state is selected, see
210 systemd.timer(5). This command only applies to units that use
211 either of these settings. If --what= is not specified, both the
212 cache and runtime data are removed (as these two types of data are
213 generally redundant and reproducible on the next invocation of the
214 unit).
215
216 freeze PATTERN...
217 Freeze one or more units specified on the command line using cgroup
218 freezer
219
220 Freezing the unit will cause all processes contained within the
221 cgroup corresponding to the unit to be suspended. Being suspended
222 means that unit's processes won't be scheduled to run on CPU until
223 thawed. Note that this command is supported only on systems that
224 use unified cgroup hierarchy. Unit is automatically thawed just
225 before we execute a job against the unit, e.g. before the unit is
226 stopped.
227
228 thaw PATTERN...
229 Thaw (unfreeze) one or more units specified on the command line.
230
231 This is the inverse operation to the freeze command and resumes the
232 execution of processes in the unit's cgroup.
233
234 is-active PATTERN...
235 Check whether any of the specified units are active (i.e. running).
236 Returns an exit code 0 if at least one is active, or non-zero
237 otherwise. Unless --quiet is specified, this will also print the
238 current unit state to standard output.
239
240 is-failed PATTERN...
241 Check whether any of the specified units are in a "failed" state.
242 Returns an exit code 0 if at least one has failed, non-zero
243 otherwise. Unless --quiet is specified, this will also print the
244 current unit state to standard output.
245
246 status [PATTERN...|PID...]]
247 Show terse runtime status information about one or more units,
248 followed by most recent log data from the journal. If no units are
249 specified, show system status. If combined with --all, also show
250 the status of all units (subject to limitations specified with -t).
251 If a PID is passed, show information about the unit the process
252 belongs to.
253
254 This function is intended to generate human-readable output. If you
255 are looking for computer-parsable output, use show instead. By
256 default, this function only shows 10 lines of output and ellipsizes
257 lines to fit in the terminal window. This can be changed with
258 --lines and --full, see above. In addition, journalctl --unit=NAME
259 or journalctl --user-unit=NAME use a similar filter for messages
260 and might be more convenient.
261
262 systemd implicitly loads units as necessary, so just running the
263 status will attempt to load a file. The command is thus not useful
264 for determining if something was already loaded or not. The units
265 may possibly also be quickly unloaded after the operation is
266 completed if there's no reason to keep it in memory thereafter.
267
268 Example 1. Example output from systemctl status
269
270 $ systemctl status bluetooth
271 ● bluetooth.service - Bluetooth service
272 Loaded: loaded (/usr/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)
273 Active: active (running) since Wed 2017-01-04 13:54:04 EST; 1 weeks 0 days ago
274 Docs: man:bluetoothd(8)
275 Main PID: 930 (bluetoothd)
276 Status: "Running"
277 Tasks: 1
278 Memory: 648.0K
279 CPU: 435ms
280 CGroup: /system.slice/bluetooth.service
281 └─930 /usr/lib/bluetooth/bluetoothd
282
283 Jan 12 10:46:45 example.com bluetoothd[8900]: Not enough free handles to register service
284 Jan 12 10:46:45 example.com bluetoothd[8900]: Current Time Service could not be registered
285 Jan 12 10:46:45 example.com bluetoothd[8900]: gatt-time-server: Input/output error (5)
286
287 The dot ("●") uses color on supported terminals to summarize the
288 unit state at a glance. White indicates an "inactive" or
289 "deactivating" state. Red indicates a "failed" or "error" state and
290 green indicates an "active", "reloading" or "activating" state.
291
292 The "Loaded:" line in the output will show "loaded" if the unit has
293 been loaded into memory. Other possible values for "Loaded:"
294 include: "error" if there was a problem loading it, "not-found" if
295 no unit file was found for this unit, "bad-setting" if an essential
296 unit file setting could not be parsed and "masked" if the unit file
297 has been masked. Along with showing the path to the unit file, this
298 line will also show the enablement state. Enabled commands start at
299 boot. See the full table of possible enablement states — including
300 the definition of "masked" — in the documentation for the
301 is-enabled command.
302
303 The "Active:" line shows active state. The value is usually
304 "active" or "inactive". Active could mean started, bound, plugged
305 in, etc depending on the unit type. The unit could also be in
306 process of changing states, reporting a state of "activating" or
307 "deactivating". A special "failed" state is entered when the
308 service failed in some way, such as a crash, exiting with an error
309 code or timing out. If the failed state is entered the cause will
310 be logged for later reference.
311
312 show [PATTERN...|JOB...]
313 Show properties of one or more units, jobs, or the manager itself.
314 If no argument is specified, properties of the manager will be
315 shown. If a unit name is specified, properties of the unit are
316 shown, and if a job ID is specified, properties of the job are
317 shown. By default, empty properties are suppressed. Use --all to
318 show those too. To select specific properties to show, use
319 --property=. This command is intended to be used whenever
320 computer-parsable output is required. Use status if you are looking
321 for formatted human-readable output.
322
323 Many properties shown by systemctl show map directly to
324 configuration settings of the system and service manager and its
325 unit files. Note that the properties shown by the command are
326 generally more low-level, normalized versions of the original
327 configuration settings and expose runtime state in addition to
328 configuration. For example, properties shown for service units
329 include the service's current main process identifier as "MainPID"
330 (which is runtime state), and time settings are always exposed as
331 properties ending in the "...USec" suffix even if a matching
332 configuration options end in "...Sec", because microseconds is the
333 normalized time unit used internally by the system and service
334 manager.
335
336 For details about many of these properties, see the documentation
337 of the D-Bus interface backing these properties, see
338 org.freedesktop.systemd1(5).
339
340 cat PATTERN...
341 Show backing files of one or more units. Prints the "fragment" and
342 "drop-ins" (source files) of units. Each file is preceded by a
343 comment which includes the file name. Note that this shows the
344 contents of the backing files on disk, which may not match the
345 system manager's understanding of these units if any unit files
346 were updated on disk and the daemon-reload command wasn't issued
347 since.
348
349 set-property UNIT PROPERTY=VALUE...
350 Set the specified unit properties at runtime where this is
351 supported. This allows changing configuration parameter properties
352 such as resource control settings at runtime. Not all properties
353 may be changed at runtime, but many resource control settings
354 (primarily those in systemd.resource-control(5)) may. The changes
355 are applied immediately, and stored on disk for future boots,
356 unless --runtime is passed, in which case the settings only apply
357 until the next reboot. The syntax of the property assignment
358 follows closely the syntax of assignments in unit files.
359
360 Example: systemctl set-property foobar.service CPUWeight=200
361
362 If the specified unit appears to be inactive, the changes will be
363 only stored on disk as described previously hence they will be
364 effective when the unit will be started.
365
366 Note that this command allows changing multiple properties at the
367 same time, which is preferable over setting them individually.
368
369 Example: systemctl set-property foobar.service CPUWeight=200
370 MemoryMax=2G IPAccounting=yes
371
372 Like with unit file configuration settings, assigning an empty
373 setting usually resets a property to its defaults.
374
375 Example: systemctl set-property avahi-daemon.service IPAddressDeny=
376
377 help PATTERN...|PID...
378 Show manual pages for one or more units, if available. If a PID is
379 given, the manual pages for the unit the process belongs to are
380 shown.
381
382 reset-failed [PATTERN...]
383 Reset the "failed" state of the specified units, or if no unit name
384 is passed, reset the state of all units. When a unit fails in some
385 way (i.e. process exiting with non-zero error code, terminating
386 abnormally or timing out), it will automatically enter the "failed"
387 state and its exit code and status is recorded for introspection by
388 the administrator until the service is stopped/re-started or reset
389 with this command.
390
391 In addition to resetting the "failed" state of a unit it also
392 resets various other per-unit properties: the start rate limit
393 counter of all unit types is reset to zero, as is the restart
394 counter of service units. Thus, if a unit's start limit (as
395 configured with StartLimitIntervalSec=/StartLimitBurst=) is hit and
396 the unit refuses to be started again, use this command to make it
397 startable again.
398
399 list-dependencies [UNIT...]
400 Shows units required and wanted by the specified units. This
401 recursively lists units following the Requires=, Requisite=,
402 ConsistsOf=, Wants=, BindsTo= dependencies. If no units are
403 specified, default.target is implied.
404
405 By default, only target units are recursively expanded. When --all
406 is passed, all other units are recursively expanded as well.
407
408 Options --reverse, --after, --before may be used to change what
409 types of dependencies are shown.
410
411 Note that this command only lists units currently loaded into
412 memory by the service manager. In particular, this command is not
413 suitable to get a comprehensive list at all reverse dependencies on
414 a specific unit, as it won't list the dependencies declared by
415 units currently not loaded.
416
417 Unit File Commands
418 list-unit-files [PATTERN...]
419 List unit files installed on the system, in combination with their
420 enablement state (as reported by is-enabled). If one or more
421 PATTERNs are specified, only unit files whose name matches one of
422 them are shown (patterns matching unit file system paths are not
423 supported).
424
425 enable UNIT..., enable PATH...
426 Enable one or more units or unit instances. This will create a set
427 of symlinks, as encoded in the [Install] sections of the indicated
428 unit files. After the symlinks have been created, the system
429 manager configuration is reloaded (in a way equivalent to
430 daemon-reload), in order to ensure the changes are taken into
431 account immediately. Note that this does not have the effect of
432 also starting any of the units being enabled. If this is desired,
433 combine this command with the --now switch, or invoke start with
434 appropriate arguments later. Note that in case of unit instance
435 enablement (i.e. enablement of units of the form foo@bar.service),
436 symlinks named the same as instances are created in the unit
437 configuration directory, however they point to the single template
438 unit file they are instantiated from.
439
440 This command expects either valid unit names (in which case various
441 unit file directories are automatically searched for unit files
442 with appropriate names), or absolute paths to unit files (in which
443 case these files are read directly). If a specified unit file is
444 located outside of the usual unit file directories, an additional
445 symlink is created, linking it into the unit configuration path,
446 thus ensuring it is found when requested by commands such as start.
447 The file system where the linked unit files are located must be
448 accessible when systemd is started (e.g. anything underneath /home
449 or /var is not allowed, unless those directories are located on the
450 root file system).
451
452 This command will print the file system operations executed. This
453 output may be suppressed by passing --quiet.
454
455 Note that this operation creates only the symlinks suggested in the
456 [Install] section of the unit files. While this command is the
457 recommended way to manipulate the unit configuration directory, the
458 administrator is free to make additional changes manually by
459 placing or removing symlinks below this directory. This is
460 particularly useful to create configurations that deviate from the
461 suggested default installation. In this case, the administrator
462 must make sure to invoke daemon-reload manually as necessary, in
463 order to ensure the changes are taken into account.
464
465 Enabling units should not be confused with starting (activating)
466 units, as done by the start command. Enabling and starting units is
467 orthogonal: units may be enabled without being started and started
468 without being enabled. Enabling simply hooks the unit into various
469 suggested places (for example, so that the unit is automatically
470 started on boot or when a particular kind of hardware is plugged
471 in). Starting actually spawns the daemon process (in case of
472 service units), or binds the socket (in case of socket units), and
473 so on.
474
475 Depending on whether --system, --user, --runtime, or --global is
476 specified, this enables the unit for the system, for the calling
477 user only, for only this boot of the system, or for all future
478 logins of all users. Note that in the last case, no systemd daemon
479 configuration is reloaded.
480
481 Using enable on masked units is not supported and results in an
482 error.
483
484 disable UNIT...
485 Disables one or more units. This removes all symlinks to the unit
486 files backing the specified units from the unit configuration
487 directory, and hence undoes any changes made by enable or link.
488 Note that this removes all symlinks to matching unit files,
489 including manually created symlinks, and not just those actually
490 created by enable or link. Note that while disable undoes the
491 effect of enable, the two commands are otherwise not symmetric, as
492 disable may remove more symlinks than a prior enable invocation of
493 the same unit created.
494
495 This command expects valid unit names only, it does not accept
496 paths to unit files.
497
498 In addition to the units specified as arguments, all units are
499 disabled that are listed in the Also= setting contained in the
500 [Install] section of any of the unit files being operated on.
501
502 This command implicitly reloads the system manager configuration
503 after completing the operation. Note that this command does not
504 implicitly stop the units that are being disabled. If this is
505 desired, either combine this command with the --now switch, or
506 invoke the stop command with appropriate arguments later.
507
508 This command will print information about the file system
509 operations (symlink removals) executed. This output may be
510 suppressed by passing --quiet.
511
512 This command honors --system, --user, --runtime and --global in a
513 similar way as enable.
514
515 reenable UNIT...
516 Reenable one or more units, as specified on the command line. This
517 is a combination of disable and enable and is useful to reset the
518 symlinks a unit file is enabled with to the defaults configured in
519 its [Install] section. This command expects a unit name only, it
520 does not accept paths to unit files.
521
522 preset UNIT...
523 Reset the enable/disable status one or more unit files, as
524 specified on the command line, to the defaults configured in the
525 preset policy files. This has the same effect as disable or enable,
526 depending how the unit is listed in the preset files.
527
528 Use --preset-mode= to control whether units shall be enabled and
529 disabled, or only enabled, or only disabled.
530
531 If the unit carries no install information, it will be silently
532 ignored by this command. UNIT must be the real unit name, any
533 alias names are ignored silently.
534
535 For more information on the preset policy format, see
536 systemd.preset(5). For more information on the concept of presets,
537 please consult the Preset[1] document.
538
539 preset-all
540 Resets all installed unit files to the defaults configured in the
541 preset policy file (see above).
542
543 Use --preset-mode= to control whether units shall be enabled and
544 disabled, or only enabled, or only disabled.
545
546 is-enabled UNIT...
547 Checks whether any of the specified unit files are enabled (as with
548 enable). Returns an exit code of 0 if at least one is enabled,
549 non-zero otherwise. Prints the current enable status (see table).
550 To suppress this output, use --quiet. To show installation targets,
551 use --full.
552
553 Table 1. is-enabled output
554 ┌──────────────────┬─────────────────────────┬───────────┐
555 │Name │ Description │ Exit Code │
556 ├──────────────────┼─────────────────────────┼───────────┤
557 │"enabled" │ Enabled via │ │
558 ├──────────────────┤ .wants/, .requires/ │ │
559 │"enabled-runtime" │ or Alias= symlinks │ │
560 │ │ (permanently in │ 0 │
561 │ │ /etc/systemd/system/, │ │
562 │ │ or transiently in │ │
563 │ │ /run/systemd/system/). │ │
564 ├──────────────────┼─────────────────────────┼───────────┤
565 │"linked" │ Made available through │ │
566 ├──────────────────┤ one or more symlinks │ │
567 │"linked-runtime" │ to the unit file │ │
568 │ │ (permanently in │ │
569 │ │ /etc/systemd/system/ │ │
570 │ │ or transiently in │ > 0 │
571 │ │ /run/systemd/system/), │ │
572 │ │ even though the unit │ │
573 │ │ file might reside │ │
574 │ │ outside of the unit │ │
575 │ │ file search path. │ │
576 ├──────────────────┼─────────────────────────┼───────────┤
577 │"alias" │ The name is an alias │ 0 │
578 │ │ (symlink to another │ │
579 │ │ unit file). │ │
580 ├──────────────────┼─────────────────────────┼───────────┤
581 │"masked" │ Completely disabled, │ │
582 ├──────────────────┤ so that any start │ │
583 │"masked-runtime" │ operation on it fails │ │
584 │ │ (permanently in │ > 0 │
585 │ │ /etc/systemd/system/ │ │
586 │ │ or transiently in │ │
587 │ │ /run/systemd/systemd/). │ │
588 ├──────────────────┼─────────────────────────┼───────────┤
589 │"static" │ The unit file is not │ 0 │
590 │ │ enabled, and has no │ │
591 │ │ provisions for enabling │ │
592 │ │ in the [Install] unit │ │
593 │ │ file section. │ │
594 ├──────────────────┼─────────────────────────┼───────────┤
595 │"indirect" │ The unit file itself is │ 0 │
596 │ │ not enabled, but it has │ │
597 │ │ a non-empty Also= │ │
598 │ │ setting in the │ │
599 │ │ [Install] unit file │ │
600 │ │ section, listing other │ │
601 │ │ unit files that might │ │
602 │ │ be enabled, or it has │ │
603 │ │ an alias under a │ │
604 │ │ different name through │ │
605 │ │ a symlink that is not │ │
606 │ │ specified in Also=. For │ │
607 │ │ template unit files, an │ │
608 │ │ instance different than │ │
609 │ │ the one specified in │ │
610 │ │ DefaultInstance= is │ │
611 │ │ enabled. │ │
612 ├──────────────────┼─────────────────────────┼───────────┤
613 │"disabled" │ The unit file is not │ > 0 │
614 │ │ enabled, but contains │ │
615 │ │ an [Install] section │ │
616 │ │ with installation │ │
617 │ │ instructions. │ │
618 ├──────────────────┼─────────────────────────┼───────────┤
619 │"generated" │ The unit file was │ 0 │
620 │ │ generated dynamically │ │
621 │ │ via a generator tool. │ │
622 │ │ See │ │
623 │ │ systemd.generator(7). │ │
624 │ │ Generated unit files │ │
625 │ │ may not be enabled, │ │
626 │ │ they are enabled │ │
627 │ │ implicitly by their │ │
628 │ │ generator. │ │
629 ├──────────────────┼─────────────────────────┼───────────┤
630 │"transient" │ The unit file has been │ 0 │
631 │ │ created dynamically │ │
632 │ │ with the runtime API. │ │
633 │ │ Transient units may not │ │
634 │ │ be enabled. │ │
635 ├──────────────────┼─────────────────────────┼───────────┤
636 │"bad" │ The unit file is │ > 0 │
637 │ │ invalid or another │ │
638 │ │ error occurred. Note │ │
639 │ │ that is-enabled will │ │
640 │ │ not actually return │ │
641 │ │ this state, but print │ │
642 │ │ an error message │ │
643 │ │ instead. However the │ │
644 │ │ unit file listing │ │
645 │ │ printed by │ │
646 │ │ list-unit-files might │ │
647 │ │ show it. │ │
648 └──────────────────┴─────────────────────────┴───────────┘
649
650 mask UNIT...
651 Mask one or more units, as specified on the command line. This will
652 link these unit files to /dev/null, making it impossible to start
653 them. This is a stronger version of disable, since it prohibits all
654 kinds of activation of the unit, including enablement and manual
655 activation. Use this option with care. This honors the --runtime
656 option to only mask temporarily until the next reboot of the
657 system. The --now option may be used to ensure that the units are
658 also stopped. This command expects valid unit names only, it does
659 not accept unit file paths.
660
661 unmask UNIT...
662 Unmask one or more unit files, as specified on the command line.
663 This will undo the effect of mask. This command expects valid unit
664 names only, it does not accept unit file paths.
665
666 link PATH...
667 Link a unit file that is not in the unit file search paths into the
668 unit file search path. This command expects an absolute path to a
669 unit file. The effect of this may be undone with disable. The
670 effect of this command is that a unit file is made available for
671 commands such as start, even though it is not installed directly in
672 the unit search path. The file system where the linked unit files
673 are located must be accessible when systemd is started (e.g.
674 anything underneath /home or /var is not allowed, unless those
675 directories are located on the root file system).
676
677 revert UNIT...
678 Revert one or more unit files to their vendor versions. This
679 command removes drop-in configuration files that modify the
680 specified units, as well as any user-configured unit file that
681 overrides a matching vendor supplied unit file. Specifically, for a
682 unit "foo.service" the matching directories "foo.service.d/" with
683 all their contained files are removed, both below the persistent
684 and runtime configuration directories (i.e. below
685 /etc/systemd/system and /run/systemd/system); if the unit file has
686 a vendor-supplied version (i.e. a unit file located below /usr) any
687 matching persistent or runtime unit file that overrides it is
688 removed, too. Note that if a unit file has no vendor-supplied
689 version (i.e. is only defined below /etc/systemd/system or
690 /run/systemd/system, but not in a unit file stored below /usr),
691 then it is not removed. Also, if a unit is masked, it is unmasked.
692
693 Effectively, this command may be used to undo all changes made with
694 systemctl edit, systemctl set-property and systemctl mask and puts
695 the original unit file with its settings back in effect.
696
697 add-wants TARGET UNIT..., add-requires TARGET UNIT...
698 Adds "Wants=" or "Requires=" dependencies, respectively, to the
699 specified TARGET for one or more units.
700
701 This command honors --system, --user, --runtime and --global in a
702 way similar to enable.
703
704 edit UNIT...
705 Edit a drop-in snippet or a whole replacement file if --full is
706 specified, to extend or override the specified unit.
707
708 Depending on whether --system (the default), --user, or --global is
709 specified, this command creates a drop-in file for each unit either
710 for the system, for the calling user, or for all futures logins of
711 all users. Then, the editor (see the "Environment" section below)
712 is invoked on temporary files which will be written to the real
713 location if the editor exits successfully.
714
715 If --full is specified, this will copy the original units instead
716 of creating drop-in files.
717
718 If --force is specified and any units do not already exist, new
719 unit files will be opened for editing.
720
721 If --runtime is specified, the changes will be made temporarily in
722 /run and they will be lost on the next reboot.
723
724 If the temporary file is empty upon exit, the modification of the
725 related unit is canceled.
726
727 After the units have been edited, systemd configuration is reloaded
728 (in a way that is equivalent to daemon-reload).
729
730 Note that this command cannot be used to remotely edit units and
731 that you cannot temporarily edit units which are in /etc, since
732 they take precedence over /run.
733
734 get-default
735 Return the default target to boot into. This returns the target
736 unit name default.target is aliased (symlinked) to.
737
738 set-default TARGET
739 Set the default target to boot into. This sets (symlinks) the
740 default.target alias to the given target unit.
741
742 Machine Commands
743 list-machines [PATTERN...]
744 List the host and all running local containers with their state. If
745 one or more PATTERNs are specified, only containers matching one of
746 them are shown.
747
748 Job Commands
749 list-jobs [PATTERN...]
750 List jobs that are in progress. If one or more PATTERNs are
751 specified, only jobs for units matching one of them are shown.
752
753 When combined with --after or --before the list is augmented with
754 information on which other job each job is waiting for, and which
755 other jobs are waiting for it, see above.
756
757 cancel JOB...
758 Cancel one or more jobs specified on the command line by their
759 numeric job IDs. If no job ID is specified, cancel all pending
760 jobs.
761
762 Environment Commands
763 systemd supports an environment block that is passed to processes the
764 manager spawns. The names of the variables can contain ASCII letters,
765 digits, and the underscore character. Variable names cannot be empty or
766 start with a digit. In variable values, most characters are allowed,
767 but non-printable characters are currently rejected. The total length
768 of the environment block is limited to _SC_ARG_MAX value defined by
769 sysconf(3).
770
771 show-environment
772 Dump the systemd manager environment block. This is the environment
773 block that is passed to all processes the manager spawns. The
774 environment block will be dumped in straight-forward form suitable
775 for sourcing into most shells. If no special characters or
776 whitespace is present in the variable values, no escaping is
777 performed, and the assignments have the form "VARIABLE=value". If
778 whitespace or characters which have special meaning to the shell
779 are present, dollar-single-quote escaping is used, and assignments
780 have the form "VARIABLE=$'value'". This syntax is known to be
781 supported by bash(1), zsh(1), ksh(1), and busybox(1)'s ash(1), but
782 not dash(1) or fish(1).
783
784 set-environment VARIABLE=VALUE...
785 Set one or more systemd manager environment variables, as specified
786 on the command line. This command will fail if variable names and
787 values do not conform to the rules listed above.
788
789 unset-environment VARIABLE...
790 Unset one or more systemd manager environment variables. If only a
791 variable name is specified, it will be removed regardless of its
792 value. If a variable and a value are specified, the variable is
793 only removed if it has the specified value.
794
795 import-environment [VARIABLE...]
796 Import all, one or more environment variables set on the client
797 into the systemd manager environment block. If no arguments are
798 passed, the entire environment block is imported. Otherwise, a list
799 of one or more environment variable names should be passed, whose
800 client-side values are then imported into the manager's environment
801 block. This command will silently ignore any assignments which do
802 not conform to the rules listed above.
803
804 Manager State Commands
805 daemon-reload
806 Reload the systemd manager configuration. This will rerun all
807 generators (see systemd.generator(7)), reload all unit files, and
808 recreate the entire dependency tree. While the daemon is being
809 reloaded, all sockets systemd listens on behalf of user
810 configuration will stay accessible.
811
812 This command should not be confused with the reload command.
813
814 daemon-reexec
815 Reexecute the systemd manager. This will serialize the manager
816 state, reexecute the process and deserialize the state again. This
817 command is of little use except for debugging and package upgrades.
818 Sometimes, it might be helpful as a heavy-weight daemon-reload.
819 While the daemon is being reexecuted, all sockets systemd listening
820 on behalf of user configuration will stay accessible.
821
822 log-level [LEVEL]
823 If no argument is given, print the current log level of the
824 manager. If an optional argument LEVEL is provided, then the
825 command changes the current log level of the manager to LEVEL
826 (accepts the same values as --log-level= described in systemd(1)).
827
828 log-target [TARGET]
829 If no argument is given, print the current log target of the
830 manager. If an optional argument TARGET is provided, then the
831 command changes the current log target of the manager to TARGET
832 (accepts the same values as --log-target=, described in
833 systemd(1)).
834
835 service-watchdogs [yes|no]
836 If no argument is given, print the current state of service runtime
837 watchdogs of the manager. If an optional boolean argument is
838 provided, then globally enables or disables the service runtime
839 watchdogs (WatchdogSec=) and emergency actions (e.g. OnFailure= or
840 StartLimitAction=); see systemd.service(5). The hardware watchdog
841 is not affected by this setting.
842
843 System Commands
844 is-system-running
845 Checks whether the system is operational. This returns success
846 (exit code 0) when the system is fully up and running, specifically
847 not in startup, shutdown or maintenance mode, and with no failed
848 services. Failure is returned otherwise (exit code non-zero). In
849 addition, the current state is printed in a short string to
850 standard output, see the table below. Use --quiet to suppress this
851 output.
852
853 Use --wait to wait until the boot process is completed before
854 printing the current state and returning the appropriate error
855 status. If --wait is in use, states initializing or starting will
856 not be reported, instead the command will block until a later state
857 (such as running or degraded) is reached.
858
859 Table 2. is-system-running output
860 ┌─────────────┬─────────────────────┬───────────┐
861 │Name │ Description │ Exit Code │
862 ├─────────────┼─────────────────────┼───────────┤
863 │initializing │ Early bootup, │ > 0 │
864 │ │ before basic.target │ │
865 │ │ is reached or the │ │
866 │ │ maintenance state │ │
867 │ │ entered. │ │
868 ├─────────────┼─────────────────────┼───────────┤
869 │starting │ Late bootup, before │ > 0 │
870 │ │ the job queue │ │
871 │ │ becomes idle for │ │
872 │ │ the first time, or │ │
873 │ │ one of the rescue │ │
874 │ │ targets are │ │
875 │ │ reached. │ │
876 ├─────────────┼─────────────────────┼───────────┤
877 │running │ The system is fully │ 0 │
878 │ │ operational. │ │
879 ├─────────────┼─────────────────────┼───────────┤
880 │degraded │ The system is │ > 0 │
881 │ │ operational but one │ │
882 │ │ or more units │ │
883 │ │ failed. │ │
884 ├─────────────┼─────────────────────┼───────────┤
885 │maintenance │ The rescue or │ > 0 │
886 │ │ emergency target is │ │
887 │ │ active. │ │
888 ├─────────────┼─────────────────────┼───────────┤
889 │stopping │ The manager is │ > 0 │
890 │ │ shutting down. │ │
891 ├─────────────┼─────────────────────┼───────────┤
892 │offline │ The manager is not │ > 0 │
893 │ │ running. │ │
894 │ │ Specifically, this │ │
895 │ │ is the operational │ │
896 │ │ state if an │ │
897 │ │ incompatible │ │
898 │ │ program is running │ │
899 │ │ as system manager │ │
900 │ │ (PID 1). │ │
901 ├─────────────┼─────────────────────┼───────────┤
902 │unknown │ The operational │ > 0 │
903 │ │ state could not be │ │
904 │ │ determined, due to │ │
905 │ │ lack of resources │ │
906 │ │ or another error │ │
907 │ │ cause. │ │
908 └─────────────┴─────────────────────┴───────────┘
909
910 default
911 Enter default mode. This is equivalent to systemctl isolate
912 default.target. This operation is blocking by default, use
913 --no-block to request asynchronous behavior.
914
915 rescue
916 Enter rescue mode. This is equivalent to systemctl isolate
917 rescue.target. This operation is blocking by default, use
918 --no-block to request asynchronous behavior.
919
920 emergency
921 Enter emergency mode. This is equivalent to systemctl isolate
922 emergency.target. This operation is blocking by default, use
923 --no-block to request asynchronous behavior.
924
925 halt
926 Shut down and halt the system. This is mostly equivalent to
927 systemctl start halt.target --job-mode=replace-irreversibly
928 --no-block, but also prints a wall message to all users. This
929 command is asynchronous; it will return after the halt operation is
930 enqueued, without waiting for it to complete. Note that this
931 operation will simply halt the OS kernel after shutting down,
932 leaving the hardware powered on. Use systemctl poweroff for
933 powering off the system (see below).
934
935 If combined with --force, shutdown of all running services is
936 skipped, however all processes are killed and all file systems are
937 unmounted or mounted read-only, immediately followed by the system
938 halt. If --force is specified twice, the operation is immediately
939 executed without terminating any processes or unmounting any file
940 systems. This may result in data loss. Note that when --force is
941 specified twice the halt operation is executed by systemctl itself,
942 and the system manager is not contacted. This means the command
943 should succeed even when the system manager has crashed.
944
945 poweroff
946 Shut down and power-off the system. This is mostly equivalent to
947 systemctl start poweroff.target --job-mode=replace-irreversibly
948 --no-block, but also prints a wall message to all users. This
949 command is asynchronous; it will return after the power-off
950 operation is enqueued, without waiting for it to complete.
951
952 If combined with --force, shutdown of all running services is
953 skipped, however all processes are killed and all file systems are
954 unmounted or mounted read-only, immediately followed by the
955 powering off. If --force is specified twice, the operation is
956 immediately executed without terminating any processes or
957 unmounting any file systems. This may result in data loss. Note
958 that when --force is specified twice the power-off operation is
959 executed by systemctl itself, and the system manager is not
960 contacted. This means the command should succeed even when the
961 system manager has crashed.
962
963 reboot
964 Shut down and reboot the system. This is mostly equivalent to
965 systemctl start reboot.target --job-mode=replace-irreversibly
966 --no-block, but also prints a wall message to all users. This
967 command is asynchronous; it will return after the reboot operation
968 is enqueued, without waiting for it to complete.
969
970 If combined with --force, shutdown of all running services is
971 skipped, however all processes are killed and all file systems are
972 unmounted or mounted read-only, immediately followed by the reboot.
973 If --force is specified twice, the operation is immediately
974 executed without terminating any processes or unmounting any file
975 systems. This may result in data loss. Note that when --force is
976 specified twice the reboot operation is executed by systemctl
977 itself, and the system manager is not contacted. This means the
978 command should succeed even when the system manager has crashed.
979
980 If the switch --reboot-argument= is given, it will be passed as the
981 optional argument to the reboot(2) system call.
982
983 kexec
984 Shut down and reboot the system via kexec. This is equivalent to
985 systemctl start kexec.target --job-mode=replace-irreversibly
986 --no-block. This command is asynchronous; it will return after the
987 reboot operation is enqueued, without waiting for it to complete.
988
989 If combined with --force, shutdown of all running services is
990 skipped, however all processes are killed and all file systems are
991 unmounted or mounted read-only, immediately followed by the reboot.
992
993 exit [EXIT_CODE]
994 Ask the service manager to quit. This is only supported for user
995 service managers (i.e. in conjunction with the --user option) or in
996 containers and is equivalent to poweroff otherwise. This command is
997 asynchronous; it will return after the exit operation is enqueued,
998 without waiting for it to complete.
999
1000 The service manager will exit with the specified exit code, if
1001 EXIT_CODE is passed.
1002
1003 switch-root ROOT [INIT]
1004 Switches to a different root directory and executes a new system
1005 manager process below it. This is intended for usage in initial RAM
1006 disks ("initrd"), and will transition from the initrd's system
1007 manager process (a.k.a. "init" process) to the main system manager
1008 process which is loaded from the actual host volume. This call
1009 takes two arguments: the directory that is to become the new root
1010 directory, and the path to the new system manager binary below it
1011 to execute as PID 1. If the latter is omitted or the empty string,
1012 a systemd binary will automatically be searched for and used as
1013 init. If the system manager path is omitted, equal to the empty
1014 string or identical to the path to the systemd binary, the state of
1015 the initrd's system manager process is passed to the main system
1016 manager, which allows later introspection of the state of the
1017 services involved in the initrd boot phase.
1018
1019 suspend
1020 Suspend the system. This will trigger activation of the special
1021 target unit suspend.target. This command is asynchronous, and will
1022 return after the suspend operation is successfully enqueued. It
1023 will not wait for the suspend/resume cycle to complete.
1024
1025 hibernate
1026 Hibernate the system. This will trigger activation of the special
1027 target unit hibernate.target. This command is asynchronous, and
1028 will return after the hibernation operation is successfully
1029 enqueued. It will not wait for the hibernate/thaw cycle to
1030 complete.
1031
1032 hybrid-sleep
1033 Hibernate and suspend the system. This will trigger activation of
1034 the special target unit hybrid-sleep.target. This command is
1035 asynchronous, and will return after the hybrid sleep operation is
1036 successfully enqueued. It will not wait for the sleep/wake-up cycle
1037 to complete.
1038
1039 suspend-then-hibernate
1040 Suspend the system and hibernate it after the delay specified in
1041 systemd-sleep.conf. This will trigger activation of the special
1042 target unit suspend-then-hibernate.target. This command is
1043 asynchronous, and will return after the hybrid sleep operation is
1044 successfully enqueued. It will not wait for the sleep/wake-up or
1045 hibernate/thaw cycle to complete.
1046
1047 Parameter Syntax
1048 Unit commands listed above take either a single unit name (designated
1049 as UNIT), or multiple unit specifications (designated as PATTERN...).
1050 In the first case, the unit name with or without a suffix must be
1051 given. If the suffix is not specified (unit name is "abbreviated"),
1052 systemctl will append a suitable suffix, ".service" by default, and a
1053 type-specific suffix in case of commands which operate only on specific
1054 unit types. For example,
1055
1056 # systemctl start sshd
1057
1058 and
1059
1060 # systemctl start sshd.service
1061
1062 are equivalent, as are
1063
1064 # systemctl isolate default
1065
1066 and
1067
1068 # systemctl isolate default.target
1069
1070 Note that (absolute) paths to device nodes are automatically converted
1071 to device unit names, and other (absolute) paths to mount unit names.
1072
1073 # systemctl status /dev/sda
1074 # systemctl status /home
1075
1076 are equivalent to:
1077
1078 # systemctl status dev-sda.device
1079 # systemctl status home.mount
1080
1081 In the second case, shell-style globs will be matched against the
1082 primary names of all units currently in memory; literal unit names,
1083 with or without a suffix, will be treated as in the first case. This
1084 means that literal unit names always refer to exactly one unit, but
1085 globs may match zero units and this is not considered an error.
1086
1087 Glob patterns use fnmatch(3), so normal shell-style globbing rules are
1088 used, and "*", "?", "[]" may be used. See glob(7) for more details. The
1089 patterns are matched against the primary names of units currently in
1090 memory, and patterns which do not match anything are silently skipped.
1091 For example:
1092
1093 # systemctl stop sshd@*.service
1094
1095 will stop all sshd@.service instances. Note that alias names of units,
1096 and units that aren't in memory are not considered for glob expansion.
1097
1098 For unit file commands, the specified UNIT should be the name of the
1099 unit file (possibly abbreviated, see above), or the absolute path to
1100 the unit file:
1101
1102 # systemctl enable foo.service
1103
1104 or
1105
1106 # systemctl link /path/to/foo.service
1107
1108
1110 The following options are understood:
1111
1112 -t, --type=
1113 The argument should be a comma-separated list of unit types such as
1114 service and socket.
1115
1116 If one of the arguments is a unit type, when listing units, limit
1117 display to certain unit types. Otherwise, units of all types will
1118 be shown.
1119
1120 As a special case, if one of the arguments is help, a list of
1121 allowed values will be printed and the program will exit.
1122
1123 --state=
1124 The argument should be a comma-separated list of unit LOAD, SUB, or
1125 ACTIVE states. When listing units, show only those in the specified
1126 states. Use --state=failed to show only failed units.
1127
1128 As a special case, if one of the arguments is help, a list of
1129 allowed values will be printed and the program will exit.
1130
1131 -p, --property=
1132 When showing unit/job/manager properties with the show command,
1133 limit display to properties specified in the argument. The argument
1134 should be a comma-separated list of property names, such as
1135 "MainPID". Unless specified, all known properties are shown. If
1136 specified more than once, all properties with the specified names
1137 are shown. Shell completion is implemented for property names.
1138
1139 For the manager itself, systemctl show will show all available
1140 properties. Those properties are documented in systemd-
1141 system.conf(5).
1142
1143 Properties for units vary by unit type, so showing any unit (even a
1144 non-existent one) is a way to list properties pertaining to this
1145 type. Similarly, showing any job will list properties pertaining to
1146 all jobs. Properties for units are documented in systemd.unit(5),
1147 and the pages for individual unit types systemd.service(5),
1148 systemd.socket(5), etc.
1149
1150 -P
1151 Equivalent to --value --property=, i.e. shows the value of the
1152 property without the property name or "=". Note that using -P once
1153 will also affect all properties listed with -p/--property=.
1154
1155 -a, --all
1156 When listing units with list-units, also show inactive units and
1157 units which are following other units. When showing
1158 unit/job/manager properties, show all properties regardless whether
1159 they are set or not.
1160
1161 To list all units installed in the file system, use the
1162 list-unit-files command instead.
1163
1164 When listing units with list-dependencies, recursively show
1165 dependencies of all dependent units (by default only dependencies
1166 of target units are shown).
1167
1168 When used with status, show journal messages in full, even if they
1169 include unprintable characters or are very long. By default, fields
1170 with unprintable characters are abbreviated as "blob data". (Note
1171 that the pager may escape unprintable characters again.)
1172
1173 -r, --recursive
1174 When listing units, also show units of local containers. Units of
1175 local containers will be prefixed with the container name,
1176 separated by a single colon character (":").
1177
1178 --reverse
1179 Show reverse dependencies between units with list-dependencies,
1180 i.e. follow dependencies of type WantedBy=, RequiredBy=, PartOf=,
1181 BoundBy=, instead of Wants= and similar.
1182
1183 --after
1184 With list-dependencies, show the units that are ordered before the
1185 specified unit. In other words, recursively list units following
1186 the After= dependency.
1187
1188 Note that any After= dependency is automatically mirrored to create
1189 a Before= dependency. Temporal dependencies may be specified
1190 explicitly, but are also created implicitly for units which are
1191 WantedBy= targets (see systemd.target(5)), and as a result of other
1192 directives (for example RequiresMountsFor=). Both explicitly and
1193 implicitly introduced dependencies are shown with
1194 list-dependencies.
1195
1196 When passed to the list-jobs command, for each printed job show
1197 which other jobs are waiting for it. May be combined with --before
1198 to show both the jobs waiting for each job as well as all jobs each
1199 job is waiting for.
1200
1201 --before
1202 With list-dependencies, show the units that are ordered after the
1203 specified unit. In other words, recursively list units following
1204 the Before= dependency.
1205
1206 When passed to the list-jobs command, for each printed job show
1207 which other jobs it is waiting for. May be combined with --after to
1208 show both the jobs waiting for each job as well as all jobs each
1209 job is waiting for.
1210
1211 --with-dependencies
1212 When used with status, cat, list-units, and list-unit-files, those
1213 commands print all specified units and the dependencies of those
1214 units.
1215
1216 Options --reverse, --after, --before may be used to change what
1217 types of dependencies are shown.
1218
1219 -l, --full
1220 Do not ellipsize unit names, process tree entries, journal output,
1221 or truncate unit descriptions in the output of status, list-units,
1222 list-jobs, and list-timers.
1223
1224 Also, show installation targets in the output of is-enabled.
1225
1226 --value
1227 When printing properties with show, only print the value, and skip
1228 the property name and "=". Also see option -P above.
1229
1230 --show-types
1231 When showing sockets, show the type of the socket.
1232
1233 --job-mode=
1234 When queuing a new job, this option controls how to deal with
1235 already queued jobs. It takes one of "fail", "replace",
1236 "replace-irreversibly", "isolate", "ignore-dependencies",
1237 "ignore-requirements", "flush", or "triggering". Defaults to
1238 "replace", except when the isolate command is used which implies
1239 the "isolate" job mode.
1240
1241 If "fail" is specified and a requested operation conflicts with a
1242 pending job (more specifically: causes an already pending start job
1243 to be reversed into a stop job or vice versa), cause the operation
1244 to fail.
1245
1246 If "replace" (the default) is specified, any conflicting pending
1247 job will be replaced, as necessary.
1248
1249 If "replace-irreversibly" is specified, operate like "replace", but
1250 also mark the new jobs as irreversible. This prevents future
1251 conflicting transactions from replacing these jobs (or even being
1252 enqueued while the irreversible jobs are still pending).
1253 Irreversible jobs can still be cancelled using the cancel command.
1254 This job mode should be used on any transaction which pulls in
1255 shutdown.target.
1256
1257 "isolate" is only valid for start operations and causes all other
1258 units to be stopped when the specified unit is started. This mode
1259 is always used when the isolate command is used.
1260
1261 "flush" will cause all queued jobs to be canceled when the new job
1262 is enqueued.
1263
1264 If "ignore-dependencies" is specified, then all unit dependencies
1265 are ignored for this new job and the operation is executed
1266 immediately. If passed, no required units of the unit passed will
1267 be pulled in, and no ordering dependencies will be honored. This is
1268 mostly a debugging and rescue tool for the administrator and should
1269 not be used by applications.
1270
1271 "ignore-requirements" is similar to "ignore-dependencies", but only
1272 causes the requirement dependencies to be ignored, the ordering
1273 dependencies will still be honored.
1274
1275 "triggering" may only be used with systemctl stop. In this mode,
1276 the specified unit and any active units that trigger it are
1277 stopped. See the discussion of Triggers= in systemd.unit(5) for
1278 more information about triggering units.
1279
1280 -T, --show-transaction
1281 When enqueuing a unit job (for example as effect of a systemctl
1282 start invocation or similar), show brief information about all jobs
1283 enqueued, covering both the requested job and any added because of
1284 unit dependencies. Note that the output will only include jobs
1285 immediately part of the transaction requested. It is possible that
1286 service start-up program code run as effect of the enqueued jobs
1287 might request further jobs to be pulled in. This means that
1288 completion of the listed jobs might ultimately entail more jobs
1289 than the listed ones.
1290
1291 --fail
1292 Shorthand for --job-mode=fail.
1293
1294 When used with the kill command, if no units were killed, the
1295 operation results in an error.
1296
1297 -i, --ignore-inhibitors
1298 When system shutdown or a sleep state is requested, ignore
1299 inhibitor locks. Applications can establish inhibitor locks to
1300 avoid that certain important operations (such as CD burning or
1301 suchlike) are interrupted by system shutdown or a sleep state. Any
1302 user may take these locks and privileged users may override these
1303 locks. If any locks are taken, shutdown and sleep state requests
1304 will normally fail (unless privileged) and a list of active locks
1305 is printed. However, if --ignore-inhibitors is specified, the
1306 established locks are ignored and not shown, and the operation
1307 attempted anyway, possibly requiring additional privileges.
1308
1309 --dry-run
1310 Just print what would be done. Currently supported by verbs halt,
1311 poweroff, reboot, kexec, suspend, hibernate, hybrid-sleep,
1312 suspend-then-hibernate, default, rescue, emergency, and exit.
1313
1314 -q, --quiet
1315 Suppress printing of the results of various commands and also the
1316 hints about truncated log lines. This does not suppress output of
1317 commands for which the printed output is the only result (like
1318 show). Errors are always printed.
1319
1320 --no-block
1321 Do not synchronously wait for the requested operation to finish. If
1322 this is not specified, the job will be verified, enqueued and
1323 systemctl will wait until the unit's start-up is completed. By
1324 passing this argument, it is only verified and enqueued. This
1325 option may not be combined with --wait.
1326
1327 --wait
1328 Synchronously wait for started units to terminate again. This
1329 option may not be combined with --no-block. Note that this will
1330 wait forever if any given unit never terminates (by itself or by
1331 getting stopped explicitly); particularly services which use
1332 "RemainAfterExit=yes".
1333
1334 When used with is-system-running, wait until the boot process is
1335 completed before returning.
1336
1337 --user
1338 Talk to the service manager of the calling user, rather than the
1339 service manager of the system.
1340
1341 --system
1342 Talk to the service manager of the system. This is the implied
1343 default.
1344
1345 --failed
1346 List units in failed state. This is equivalent to --state=failed.
1347
1348 --no-wall
1349 Do not send wall message before halt, power-off and reboot.
1350
1351 --global
1352 When used with enable and disable, operate on the global user
1353 configuration directory, thus enabling or disabling a unit file
1354 globally for all future logins of all users.
1355
1356 --no-reload
1357 When used with enable and disable, do not implicitly reload daemon
1358 configuration after executing the changes.
1359
1360 --no-ask-password
1361 When used with start and related commands, disables asking for
1362 passwords. Background services may require input of a password or
1363 passphrase string, for example to unlock system hard disks or
1364 cryptographic certificates. Unless this option is specified and the
1365 command is invoked from a terminal, systemctl will query the user
1366 on the terminal for the necessary secrets. Use this option to
1367 switch this behavior off. In this case, the password must be
1368 supplied by some other means (for example graphical password
1369 agents) or the service might fail. This also disables querying the
1370 user for authentication for privileged operations.
1371
1372 --kill-who=
1373 When used with kill, choose which processes to send a signal to.
1374 Must be one of main, control or all to select whether to kill only
1375 the main process, the control process or all processes of the unit.
1376 The main process of the unit is the one that defines the life-time
1377 of it. A control process of a unit is one that is invoked by the
1378 manager to induce state changes of it. For example, all processes
1379 started due to the ExecStartPre=, ExecStop= or ExecReload= settings
1380 of service units are control processes. Note that there is only one
1381 control process per unit at a time, as only one state change is
1382 executed at a time. For services of type Type=forking, the initial
1383 process started by the manager for ExecStart= is a control process,
1384 while the process ultimately forked off by that one is then
1385 considered the main process of the unit (if it can be determined).
1386 This is different for service units of other types, where the
1387 process forked off by the manager for ExecStart= is always the main
1388 process itself. A service unit consists of zero or one main
1389 process, zero or one control process plus any number of additional
1390 processes. Not all unit types manage processes of these types
1391 however. For example, for mount units, control processes are
1392 defined (which are the invocations of /usr/bin/mount and
1393 /usr/bin/umount), but no main process is defined. If omitted,
1394 defaults to all.
1395
1396 -s, --signal=
1397 When used with kill, choose which signal to send to selected
1398 processes. Must be one of the well-known signal specifiers such as
1399 SIGTERM, SIGINT or SIGSTOP. If omitted, defaults to SIGTERM.
1400
1401 --what=
1402 Select what type of per-unit resources to remove when the clean
1403 command is invoked, see below. Takes one of configuration, state,
1404 cache, logs, runtime to select the type of resource. This option
1405 may be specified more than once, in which case all specified
1406 resource types are removed. Also accepts the special value all as a
1407 shortcut for specifying all five resource types. If this option is
1408 not specified defaults to the combination of cache and runtime,
1409 i.e. the two kinds of resources that are generally considered to be
1410 redundant and can be reconstructed on next invocation.
1411
1412 -f, --force
1413 When used with enable, overwrite any existing conflicting symlinks.
1414
1415 When used with edit, create all of the specified units which do not
1416 already exist.
1417
1418 When used with halt, poweroff, reboot or kexec, execute the
1419 selected operation without shutting down all units. However, all
1420 processes will be killed forcibly and all file systems are
1421 unmounted or remounted read-only. This is hence a drastic but
1422 relatively safe option to request an immediate reboot. If --force
1423 is specified twice for these operations (with the exception of
1424 kexec), they will be executed immediately, without terminating any
1425 processes or unmounting any file systems. Warning: specifying
1426 --force twice with any of these operations might result in data
1427 loss. Note that when --force is specified twice the selected
1428 operation is executed by systemctl itself, and the system manager
1429 is not contacted. This means the command should succeed even when
1430 the system manager has crashed.
1431
1432 --message=
1433 When used with halt, poweroff or reboot, set a short message
1434 explaining the reason for the operation. The message will be logged
1435 together with the default shutdown message.
1436
1437 --now
1438 When used with enable, the units will also be started. When used
1439 with disable or mask, the units will also be stopped. The start or
1440 stop operation is only carried out when the respective enable or
1441 disable operation has been successful.
1442
1443 --root=
1444 When used with enable/disable/is-enabled (and related commands),
1445 use the specified root path when looking for unit files. If this
1446 option is present, systemctl will operate on the file system
1447 directly, instead of communicating with the systemd daemon to carry
1448 out changes.
1449
1450 --runtime
1451 When used with enable, disable, edit, (and related commands), make
1452 changes only temporarily, so that they are lost on the next reboot.
1453 This will have the effect that changes are not made in
1454 subdirectories of /etc but in /run, with identical immediate
1455 effects, however, since the latter is lost on reboot, the changes
1456 are lost too.
1457
1458 Similarly, when used with set-property, make changes only
1459 temporarily, so that they are lost on the next reboot.
1460
1461 --preset-mode=
1462 Takes one of "full" (the default), "enable-only", "disable-only".
1463 When used with the preset or preset-all commands, controls whether
1464 units shall be disabled and enabled according to the preset rules,
1465 or only enabled, or only disabled.
1466
1467 -n, --lines=
1468 When used with status, controls the number of journal lines to
1469 show, counting from the most recent ones. Takes a positive integer
1470 argument, or 0 to disable journal output. Defaults to 10.
1471
1472 -o, --output=
1473 When used with status, controls the formatting of the journal
1474 entries that are shown. For the available choices, see
1475 journalctl(1). Defaults to "short".
1476
1477 --firmware-setup
1478 When used with the reboot command, indicate to the system's
1479 firmware to reboot into the firmware setup interface. Note that
1480 this functionality is not available on all systems.
1481
1482 --boot-loader-menu=
1483 When used with the reboot command, indicate to the system's boot
1484 loader to show the boot loader menu on the following boot. Takes a
1485 time value as parameter — indicating the menu timeout. Pass zero in
1486 order to disable the menu timeout. Note that not all boot loaders
1487 support this functionality.
1488
1489 --boot-loader-entry=
1490 When used with the reboot command, indicate to the system's boot
1491 loader to boot into a specific boot loader entry on the following
1492 boot. Takes a boot loader entry identifier as argument, or "help"
1493 in order to list available entries. Note that not all boot loaders
1494 support this functionality.
1495
1496 --reboot-argument=
1497 This switch is used with reboot. The value is architecture and
1498 firmware specific. As an example, "recovery" might be used to
1499 trigger system recovery, and "fota" might be used to trigger a
1500 “firmware over the air” update.
1501
1502 --plain
1503 When used with list-dependencies, list-units or list-machines, the
1504 output is printed as a list instead of a tree, and the bullet
1505 circles are omitted.
1506
1507 -H, --host=
1508 Execute the operation remotely. Specify a hostname, or a username
1509 and hostname separated by "@", to connect to. The hostname may
1510 optionally be suffixed by a port ssh is listening on, separated by
1511 ":", and then a container name, separated by "/", which connects
1512 directly to a specific container on the specified host. This will
1513 use SSH to talk to the remote machine manager instance. Container
1514 names may be enumerated with machinectl -H HOST. Put IPv6 addresses
1515 in brackets.
1516
1517 -M, --machine=
1518 Execute operation on a local container. Specify a container name to
1519 connect to.
1520
1521 --no-pager
1522 Do not pipe output into a pager.
1523
1524 --no-legend
1525 Do not print the legend, i.e. column headers and the footer with
1526 hints.
1527
1528 -h, --help
1529 Print a short help text and exit.
1530
1531 --version
1532 Print a short version string and exit.
1533
1535 On success, 0 is returned, a non-zero failure code otherwise.
1536
1537 systemctl uses the return codes defined by LSB, as defined in LSB
1538 3.0.0[2].
1539
1540 Table 3. LSB return codes
1541 ┌──────┬─────────────────────┬─────────────────────┐
1542 │Value │ Description in LSB │ Use in systemd │
1543 ├──────┼─────────────────────┼─────────────────────┤
1544 │0 │ "program is running │ unit is active │
1545 │ │ or service is OK" │ │
1546 ├──────┼─────────────────────┼─────────────────────┤
1547 │1 │ "program is dead │ unit not failed │
1548 │ │ and /var/run pid │ (used by is-failed) │
1549 │ │ file exists" │ │
1550 ├──────┼─────────────────────┼─────────────────────┤
1551 │2 │ "program is dead │ unused │
1552 │ │ and /var/lock lock │ │
1553 │ │ file exists" │ │
1554 ├──────┼─────────────────────┼─────────────────────┤
1555 │3 │ "program is not │ unit is not active │
1556 │ │ running" │ │
1557 ├──────┼─────────────────────┼─────────────────────┤
1558 │4 │ "program or service │ no such unit │
1559 │ │ status is unknown" │ │
1560 └──────┴─────────────────────┴─────────────────────┘
1561
1562 The mapping of LSB service states to systemd unit states is imperfect,
1563 so it is better to not rely on those return values but to look for
1564 specific unit states and substates instead.
1565
1567 $SYSTEMD_EDITOR
1568 Editor to use when editing units; overrides $EDITOR and $VISUAL. If
1569 neither $SYSTEMD_EDITOR nor $EDITOR nor $VISUAL are present or if
1570 it is set to an empty string or if their execution failed,
1571 systemctl will try to execute well known editors in this order:
1572 editor(1), nano(1), vim(1), vi(1).
1573
1574 $SYSTEMD_PAGER
1575 Pager to use when --no-pager is not given; overrides $PAGER. If
1576 neither $SYSTEMD_PAGER nor $PAGER are set, a set of well-known
1577 pager implementations are tried in turn, including less(1) and
1578 more(1), until one is found. If no pager implementation is
1579 discovered no pager is invoked. Setting this environment variable
1580 to an empty string or the value "cat" is equivalent to passing
1581 --no-pager.
1582
1583 $SYSTEMD_LESS
1584 Override the options passed to less (by default "FRSXMK").
1585
1586 Users might want to change two options in particular:
1587
1588 K
1589 This option instructs the pager to exit immediately when Ctrl+C
1590 is pressed. To allow less to handle Ctrl+C itself to switch
1591 back to the pager command prompt, unset this option.
1592
1593 If the value of $SYSTEMD_LESS does not include "K", and the
1594 pager that is invoked is less, Ctrl+C will be ignored by the
1595 executable, and needs to be handled by the pager.
1596
1597 X
1598 This option instructs the pager to not send termcap
1599 initialization and deinitialization strings to the terminal. It
1600 is set by default to allow command output to remain visible in
1601 the terminal even after the pager exits. Nevertheless, this
1602 prevents some pager functionality from working, in particular
1603 paged output cannot be scrolled with the mouse.
1604
1605 See less(1) for more discussion.
1606
1607 $SYSTEMD_LESSCHARSET
1608 Override the charset passed to less (by default "utf-8", if the
1609 invoking terminal is determined to be UTF-8 compatible).
1610
1611 $SYSTEMD_PAGERSECURE
1612 Takes a boolean argument. When true, the "secure" mode of the pager
1613 is enabled; if false, disabled. If $SYSTEMD_PAGERSECURE is not set
1614 at all, secure mode is enabled if the effective UID is not the same
1615 as the owner of the login session, see geteuid(2) and
1616 sd_pid_get_owner_uid(3). In secure mode, LESSSECURE=1 will be set
1617 when invoking the pager, and the pager shall disable commands that
1618 open or create new files or start new subprocesses. When
1619 $SYSTEMD_PAGERSECURE is not set at all, pagers which are not known
1620 to implement secure mode will not be used. (Currently only less(1)
1621 implements secure mode.)
1622
1623 Note: when commands are invoked with elevated privileges, for
1624 example under sudo(8) or pkexec(1), care must be taken to ensure
1625 that unintended interactive features are not enabled. "Secure" mode
1626 for the pager may be enabled automatically as describe above.
1627 Setting SYSTEMD_PAGERSECURE=0 or not removing it from the inherited
1628 environment allows the user to invoke arbitrary commands. Note that
1629 if the $SYSTEMD_PAGER or $PAGER variables are to be honoured,
1630 $SYSTEMD_PAGERSECURE must be set too. It might be reasonable to
1631 completly disable the pager using --no-pager instead.
1632
1633 $SYSTEMD_COLORS
1634 The value must be a boolean. Controls whether colorized output
1635 should be generated. This can be specified to override the decision
1636 that systemd makes based on $TERM and what the console is connected
1637 to.
1638
1639 $SYSTEMD_URLIFY
1640 The value must be a boolean. Controls whether clickable links
1641 should be generated in the output for terminal emulators supporting
1642 this. This can be specified to override the decision that systemd
1643 makes based on $TERM and other conditions.
1644
1646 systemd(1), journalctl(1), loginctl(1), machinectl(1), systemd.unit(5),
1647 systemd.resource-control(5), systemd.special(7), wall(1),
1648 systemd.preset(5), systemd.generator(7), glob(7)
1649
1651 1. Preset
1652 https://www.freedesktop.org/wiki/Software/systemd/Preset
1653
1654 2. LSB 3.0.0
1655 http://refspecs.linuxbase.org/LSB_3.0.0/LSB-PDA/LSB-PDA/iniscrptact.html
1656
1657
1658
1659systemd 246 SYSTEMCTL(1)