1SYSTEMCTL(1) systemctl SYSTEMCTL(1)
2
3
4
6 systemctl - Control the systemd system and service manager
7
9 systemctl [OPTIONS...] COMMAND [NAME...]
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 options are understood:
19
20 -t, --type=
21 The argument should be a comma-separated list of unit types such as
22 service and socket.
23
24 If one of the arguments is a unit type, when listing units, limit
25 display to certain unit types. Otherwise, units of all types will
26 be shown.
27
28 As a special case, if one of the arguments is help, a list of
29 allowed values will be printed and the program will exit.
30
31 --state=
32 The argument should be a comma-separated list of unit LOAD, SUB, or
33 ACTIVE states. When listing units, show only those in specified
34 states. Use --state=failed to show only failed units.
35
36 -p, --property=
37 When showing unit/job/manager properties with the show command,
38 limit display to properties specified in the argument. The argument
39 should be a comma-separated list of property names, such as
40 "MainPID". Unless specified, all known properties are shown. If
41 specified more than once, all properties with the specified names
42 are shown. Shell completion is implemented for property names.
43
44 For the manager itself, systemctl show will show all available
45 properties. Those properties are documented in systemd-
46 system.conf(5).
47
48 Properties for units vary by unit type, so showing any unit (even a
49 non-existent one) is a way to list properties pertaining to this
50 type. Similarly showing any job will list properties pertaining to
51 all jobs. Properties for units are documented in systemd.unit(5),
52 and the pages for individual unit types systemd.service(5),
53 systemd.socket(5), etc.
54
55 -a, --all
56 When listing units, show all loaded units, regardless of their
57 state, including inactive units. When showing unit/job/manager
58 properties, show all properties regardless whether they are set or
59 not.
60
61 To list all units installed on the system, use the list-unit-files
62 command instead.
63
64 -r, --recursive
65 When listing units, also show units of local containers. Units of
66 local containers will be prefixed with the container name,
67 separated by a single colon character (":").
68
69 --reverse
70 Show reverse dependencies between units with list-dependencies,
71 i.e. follow dependencies of type WantedBy=, RequiredBy=,
72 RequiredByOverrridable=, PartOf=, BoundBy=, instead of Wants= and
73 similar.
74
75 --after
76 With list-dependencies, show the units that are ordered before the
77 specified unit. In other words, recursively list units following
78 the After= dependency.
79
80 Note that any After= dependency is automatically mirrored to create
81 a Before= dependency. Temporal dependencies may be specified
82 explicitly, but are also created implicitly for units which are
83 WantedBy= targets (see systemd.target(5)), and as a result of other
84 directives (for example RequiresMountsFor=). Both explicitly and
85 implicitly introduced dependencies are shown with
86 list-dependencies.
87
88 --before
89 With list-dependencies, show the units that are ordered after the
90 specified unit. In other words, recursively list units following
91 the Before= dependency.
92
93 -l, --full
94 Do not ellipsize unit names, process tree entries, journal output,
95 or truncate unit descriptions in the output of status, list-units,
96 list-jobs, and list-timers.
97
98 Also, show installation targets in the output of is-enabled.
99
100 --show-types
101 When showing sockets, show the type of the socket.
102
103 --job-mode=
104 When queuing a new job, this option controls how to deal with
105 already queued jobs. It takes one of "fail", "replace",
106 "replace-irreversibly", "isolate", "ignore-dependencies",
107 "ignore-requirements" or "flush". Defaults to "replace", except
108 when the isolate command is used which implies the "isolate" job
109 mode.
110
111 If "fail" is specified and a requested operation conflicts with a
112 pending job (more specifically: causes an already pending start job
113 to be reversed into a stop job or vice versa), cause the operation
114 to fail.
115
116 If "replace" (the default) is specified, any conflicting pending
117 job will be replaced, as necessary.
118
119 If "replace-irreversibly" is specified, operate like "replace", but
120 also mark the new jobs as irreversible. This prevents future
121 conflicting transactions from replacing these jobs (or even being
122 enqueued while the irreversible jobs are still pending).
123 Irreversible jobs can still be cancelled using the cancel command.
124
125 "isolate" is only valid for start operations and causes all other
126 units to be stopped when the specified unit is started. This mode
127 is always used when the isolate command is used.
128
129 "flush" will cause all queued jobs to be canceled when the new job
130 is enqueued.
131
132 If "ignore-dependencies" is specified, then all unit dependencies
133 are ignored for this new job and the operation is executed
134 immediately. If passed, no required units of the unit passed will
135 be pulled in, and no ordering dependencies will be honored. This is
136 mostly a debugging and rescue tool for the administrator and should
137 not be used by applications.
138
139 "ignore-requirements" is similar to "ignore-dependencies", but only
140 causes the requirement dependencies to be ignored, the ordering
141 dependencies will still be honoured.
142
143 -i, --ignore-inhibitors
144 When system shutdown or a sleep state is requested, ignore
145 inhibitor locks. Applications can establish inhibitor locks to
146 avoid that certain important operations (such as CD burning or
147 suchlike) are interrupted by system shutdown or a sleep state. Any
148 user may take these locks and privileged users may override these
149 locks. If any locks are taken, shutdown and sleep state requests
150 will normally fail (regardless of whether privileged or not) and a
151 list of active locks is printed. However, if --ignore-inhibitors is
152 specified, the locks are ignored and not printed, and the operation
153 attempted anyway, possibly requiring additional privileges.
154
155 -q, --quiet
156 Suppress output to standard output in snapshot, is-active,
157 is-failed, is-enabled, is-system-running, enable and disable.
158
159 --no-block
160 Do not synchronously wait for the requested operation to finish. If
161 this is not specified, the job will be verified, enqueued and
162 systemctl will wait until it is completed. By passing this
163 argument, it is only verified and enqueued.
164
165 --system
166 Talk to the service manager of the system. This is the implied
167 default.
168
169 --no-wall
170 Do not send wall message before halt, power-off, reboot.
171
172 --no-reload
173 When used with enable and disable, do not implicitly reload daemon
174 configuration after executing the changes.
175
176 --no-ask-password
177 When used with start and related commands, disables asking for
178 passwords. Background services may require input of a password or
179 passphrase string, for example to unlock system hard disks or
180 cryptographic certificates. Unless this option is specified and the
181 command is invoked from a terminal, systemctl will query the user
182 on the terminal for the necessary secrets. Use this option to
183 switch this behavior off. In this case, the password must be
184 supplied by some other means (for example graphical password
185 agents) or the service might fail. This also disables querying the
186 user for authentication for privileged operations.
187
188 --kill-who=
189 When used with kill, choose which processes to send a signal to.
190 Must be one of main, control or all to select whether to kill only
191 the main process, the control process or all processes of the unit.
192 The main process of the unit is the one that defines the life-time
193 of it. A control process of a unit is one that is invoked by the
194 manager to induce state changes of it. For example, all processes
195 started due to the ExecStartPre=, ExecStop= or ExecReload= settings
196 of service units are control processes. Note that there is only one
197 control process per unit at a time, as only one state change is
198 executed at a time. For services of type Type=forking, the initial
199 process started by the manager for ExecStart= is a control process,
200 while the process ultimately forked off by that one is then
201 considered the main process of the unit (if it can be determined).
202 This is different for service units of other types, where the
203 process forked off by the manager for ExecStart= is always the main
204 process itself. A service unit consists of zero or one main
205 process, zero or one control process plus any number of additional
206 processes. Not all unit types manage processes of these types
207 however. For example, for mount units, control processes are
208 defined (which are the invocations of /usr/bin/mount and
209 /usr/bin/umount), but no main process is defined. If omitted,
210 defaults to all.
211
212 -s, --signal=
213 When used with kill, choose which signal to send to selected
214 processes. Must be one of the well known signal specifiers such as
215 SIGTERM, SIGINT or SIGSTOP. If omitted, defaults to SIGTERM.
216
217 -f, --force
218 When used with enable, overwrite any existing conflicting symlinks.
219
220 When used with halt, poweroff, reboot or kexec, execute the
221 selected operation without shutting down all units. However, all
222 processes will be killed forcibly and all file systems are
223 unmounted or remounted read-only. This is hence a drastic but
224 relatively safe option to request an immediate reboot. If --force
225 is specified twice for these operations, they will be executed
226 immediately without terminating any processes or unmounting any
227 file systems. Warning: specifying --force twice with any of these
228 operations might result in data loss.
229
230 --now
231 When used with enable, the units will also be started. When used
232 with disable or mask, the units will also be stopped. The start or
233 stop operation is only carried out when the respective enable or
234 disable operation has been successful.
235
236 --root=
237 When used with enable/disable/is-enabled (and related commands),
238 use alternative root path when looking for unit files.
239
240 --runtime
241 When used with enable, disable, edit, (and related commands), make
242 changes only temporarily, so that they are lost on the next reboot.
243 This will have the effect that changes are not made in
244 subdirectories of /etc but in /run, with identical immediate
245 effects, however, since the latter is lost on reboot, the changes
246 are lost too.
247
248 Similarly, when used with set-property, make changes only
249 temporarily, so that they are lost on the next reboot.
250
251 --preset-mode=
252 Takes one of "full" (the default), "enable-only", "disable-only".
253 When used with the preset or preset-all commands, controls whether
254 units shall be disabled and enabled according to the preset rules,
255 or only enabled, or only disabled.
256
257 -n, --lines=
258 When used with status, controls the number of journal lines to
259 show, counting from the most recent ones. Takes a positive integer
260 argument. Defaults to 10.
261
262 -o, --output=
263 When used with status, controls the formatting of the journal
264 entries that are shown. For the available choices, see
265 journalctl(1). Defaults to "short".
266
267 --plain
268 When used with list-dependencies, the output is printed as a list
269 instead of a tree.
270
271 -H, --host=
272 Execute the operation remotely. Specify a hostname, or a username
273 and hostname separated by "@", to connect to. The hostname may
274 optionally be suffixed by a container name, separated by ":", which
275 connects directly to a specific container on the specified host.
276 This will use SSH to talk to the remote machine manager instance.
277 Container names may be enumerated with machinectl -H HOST.
278
279 -M, --machine=
280 Execute operation on a local container. Specify a container name to
281 connect to.
282
283 --no-pager
284 Do not pipe output into a pager.
285
286 --no-legend
287 Do not print the legend, i.e. column headers and the footer with
288 hints.
289
290 -h, --help
291 Print a short help text and exit.
292
293 --version
294 Print a short version string and exit.
295
297 The following commands are understood:
298
299 Unit Commands
300 list-units [PATTERN...]
301 List known units (subject to limitations specified with -t). If one
302 or more PATTERNs are specified, only units matching one of them are
303 shown.
304
305 This is the default command.
306
307 list-sockets [PATTERN...]
308 List socket units ordered by listening address. If one or more
309 PATTERNs are specified, only socket units matching one of them are
310 shown. Produces output similar to
311
312 LISTEN UNIT ACTIVATES
313 /dev/initctl systemd-initctl.socket systemd-initctl.service
314 ...
315 [::]:22 sshd.socket sshd.service
316 kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service
317
318 5 sockets listed.
319
320 Note: because the addresses might contains spaces, this output is
321 not suitable for programmatic consumption.
322
323 See also the options --show-types, --all, and --state=.
324
325 list-timers [PATTERN...]
326 List timer units ordered by the time they elapse next. If one or
327 more PATTERNs are specified, only units matching one of them are
328 shown.
329
330 See also the options --all and --state=.
331
332 start PATTERN...
333 Start (activate) one or more units specified on the command line.
334
335 Note that glob patterns operate on a list of currently loaded
336 units. Units which are not active and are not in a failed state
337 usually are not loaded, and would not be matched by any pattern. In
338 addition, in case of instantiated units, systemd is often unaware
339 of the instance name until the instance has been started.
340 Therefore, using glob patterns with start has limited usefulness.
341
342 stop PATTERN...
343 Stop (deactivate) one or more units specified on the command line.
344
345 reload PATTERN...
346 Asks all units listed on the command line to reload their
347 configuration. Note that this will reload the service-specific
348 configuration, not the unit configuration file of systemd. If you
349 want systemd to reload the configuration file of a unit, use the
350 daemon-reload command. In other words: for the example case of
351 Apache, this will reload Apache's httpd.conf in the web server, not
352 the apache.service systemd unit file.
353
354 This command should not be confused with the daemon-reload command.
355
356 restart PATTERN...
357 Restart one or more units specified on the command line. If the
358 units are not running yet, they will be started.
359
360 try-restart PATTERN...
361 Restart one or more units specified on the command line if the
362 units are running. This does nothing if units are not running. Note
363 that, for compatibility with Red Hat init scripts, condrestart is
364 equivalent to this command.
365
366 reload-or-restart PATTERN...
367 Reload one or more units if they support it. If not, restart them
368 instead. If the units are not running yet, they will be started.
369
370 reload-or-try-restart PATTERN...
371 Reload one or more units if they support it. If not, restart them
372 instead. This does nothing if the units are not running. Note that,
373 for compatibility with SysV init scripts, force-reload is
374 equivalent to this command.
375
376 isolate NAME
377 Start the unit specified on the command line and its dependencies
378 and stop all others. If a unit name with no extension is given, an
379 extension of ".target" will be assumed.
380
381 This is similar to changing the runlevel in a traditional init
382 system. The isolate command will immediately stop processes that
383 are not enabled in the new unit, possibly including the graphical
384 environment or terminal you are currently using.
385
386 Note that this is allowed only on units where AllowIsolate= is
387 enabled. See systemd.unit(5) for details.
388
389 kill PATTERN...
390 Send a signal to one or more processes of the unit. Use --kill-who=
391 to select which process to kill. Use --signal= to select the signal
392 to send.
393
394 is-active PATTERN...
395 Check whether any of the specified units are active (i.e. running).
396 Returns an exit code 0 if at least one is active, or non-zero
397 otherwise. Unless --quiet is specified, this will also print the
398 current unit state to standard output.
399
400 is-failed PATTERN...
401 Check whether any of the specified units are in a "failed" state.
402 Returns an exit code 0 if at least one has failed, non-zero
403 otherwise. Unless --quiet is specified, this will also print the
404 current unit state to standard output.
405
406 status [PATTERN...|PID...]]
407 Show terse runtime status information about one or more units,
408 followed by most recent log data from the journal. If no units are
409 specified, show system status. If combined with --all, also show
410 the status of all units (subject to limitations specified with -t).
411 If a PID is passed, show information about the unit the process
412 belongs to.
413
414 This function is intended to generate human-readable output. If you
415 are looking for computer-parsable output, use show instead. By
416 default this function only shows 10 lines of output and ellipsizes
417 lines to fit in the terminal window. This can be changes with
418 --lines and --full, see above. In addition, journalctl --unit=NAME
419 use a similar filter for messages and might be more convenient.
420
421 show [PATTERN...|JOB...]
422 Show properties of one or more units, jobs, or the manager itself.
423 If no argument is specified, properties of the manager will be
424 shown. If a unit name is specified, properties of the unit is
425 shown, and if a job id is specified, properties of the job is
426 shown. By default, empty properties are suppressed. Use --all to
427 show those too. To select specific properties to show, use
428 --property=. This command is intended to be used whenever
429 computer-parsable output is required. Use status if you are looking
430 for formatted human-readable output.
431
432 cat PATTERN...
433 Show backing files of one or more units. Prints the "fragment" and
434 "drop-ins" (source files) of units. Each file is preceded by a
435 comment which includes the file name.
436
437 set-property NAME ASSIGNMENT...
438 Set the specified unit properties at runtime where this is
439 supported. This allows changing configuration parameter properties
440 such as resource control settings at runtime. Not all properties
441 may be changed at runtime, but many resource control settings
442 (primarily those in systemd.resource-control(5)) may. The changes
443 are applied instantly, and stored on disk for future boots, unless
444 --runtime is passed, in which case the settings only apply until
445 the next reboot. The syntax of the property assignment follows
446 closely the syntax of assignments in unit files.
447
448 Example: systemctl set-property foobar.service CPUShares=777
449
450 Note that this command allows changing multiple properties at the
451 same time, which is preferable over setting them individually. Like
452 unit file configuration settings, assigning the empty list to list
453 parameters will reset the list.
454
455 help PATTERN...|PID...
456 Show manual pages for one or more units, if available. If a PID is
457 given, the manual pages for the unit the process belongs to are
458 shown.
459
460 reset-failed [PATTERN...]
461 Reset the "failed" state of the specified units, or if no unit name
462 is passed, reset the state of all units. When a unit fails in some
463 way (i.e. process exiting with non-zero error code, terminating
464 abnormally or timing out), it will automatically enter the "failed"
465 state and its exit code and status is recorded for introspection by
466 the administrator until the service is restarted or reset with this
467 command.
468
469 list-dependencies [NAME]
470 Shows units required and wanted by the specified unit. This
471 recursively lists units following the Requires=,
472 RequiresOverridable=, Requisite=, RequisiteOverridable=, Wants=,
473 BindsTo= dependencies. If no unit is specified, default.target is
474 implied.
475
476 By default, only target units are recursively expanded. When --all
477 is passed, all other units are recursively expanded as well.
478
479 Options --reverse, --after, --before may be used to change what
480 types of dependencies are shown.
481
482 Unit File Commands
483 list-unit-files [PATTERN...]
484 List installed unit files and their enablement state (as reported
485 by is-enabled). If one or more PATTERNs are specified, only units
486 whose filename (just the last component of the path) matches one of
487 them are shown.
488
489 enable NAME...
490 Enable one or more unit files or unit file instances, as specified
491 on the command line. This will create a number of symlinks as
492 encoded in the "[Install]" sections of the unit files. After the
493 symlinks have been created, the systemd configuration is reloaded
494 (in a way that is equivalent to daemon-reload) to ensure the
495 changes are taken into account immediately. Note that this does not
496 have the effect of also starting any of the units being enabled. If
497 this is desired, either --now should be used together with this
498 command, or an additional start command must be invoked for the
499 unit. Also note that in case of instance enablement, symlinks named
500 the same as instances are created in the install location, however
501 they all point to the same template unit file.
502
503 This command will print the actions executed. This output may be
504 suppressed by passing --quiet.
505
506 Note that this operation creates only the suggested symlinks for
507 the units. While this command is the recommended way to manipulate
508 the unit configuration directory, the administrator is free to make
509 additional changes manually by placing or removing symlinks in the
510 directory. This is particularly useful to create configurations
511 that deviate from the suggested default installation. In this case,
512 the administrator must make sure to invoke daemon-reload manually
513 as necessary to ensure the changes are taken into account.
514
515 Enabling units should not be confused with starting (activating)
516 units, as done by the start command. Enabling and starting units is
517 orthogonal: units may be enabled without being started and started
518 without being enabled. Enabling simply hooks the unit into various
519 suggested places (for example, so that the unit is automatically
520 started on boot or when a particular kind of hardware is plugged
521 in). Starting actually spawns the daemon process (in case of
522 service units), or binds the socket (in case of socket units), and
523 so on.
524
525 If --runtime is specified, then this enables the unit only this
526 boot.
527
528 Using enable on masked units results in an error.
529
530 disable NAME...
531 Disables one or more units. This removes all symlinks to the
532 specified unit files from the unit configuration directory, and
533 hence undoes the changes made by enable. Note however that this
534 removes all symlinks to the unit files (i.e. including manual
535 additions), not just those actually created by enable. This call
536 implicitly reloads the systemd daemon configuration after
537 completing the disabling of the units. Note that this command does
538 not implicitly stop the units that are being disabled. If this is
539 desired, either --now should be used together with this command, or
540 an additional stop command should be executed afterwards.
541
542 This command will print the actions executed. This output may be
543 suppressed by passing --quiet.
544
545 This command honors --runtime in a similar way as enable.
546
547 reenable NAME...
548 Reenable one or more unit files, as specified on the command line.
549 This is a combination of disable and enable and is useful to reset
550 the symlinks a unit is enabled with to the defaults configured in
551 the "[Install]" section of the unit file.
552
553 preset NAME...
554 Reset the enable/disable status one or more unit files, as
555 specified on the command line, to the defaults configured in the
556 preset policy files. This has the same effect as disable or enable,
557 depending how the unit is listed in the preset files.
558
559 Use --preset-mode= to control whether units shall be enabled and
560 disabled, or only enabled, or only disabled.
561
562 If the unit carries no install information, it will be silently
563 ignored by this command.
564
565 For more information on the preset policy format, see
566 systemd.preset(5). For more information on the concept of presets,
567 please consult the Preset[1] document.
568
569 preset-all
570 Resets all installed unit files to the defaults configured in the
571 preset policy file (see above).
572
573 Use --preset-mode= to control whether units shall be enabled and
574 disabled, or only enabled, or only disabled.
575
576 is-enabled NAME...
577 Checks whether any of the specified unit files are enabled (as with
578 enable). Returns an exit code of 0 if at least one is enabled,
579 non-zero otherwise. Prints the current enable status (see table).
580 To suppress this output, use --quiet. To show installation targets,
581 use --full.
582
583 Table 1. is-enabled output
584 ┌──────────────────┬─────────────────────┬──────────────┐
585 │Printed string │ Meaning │ Return value │
586 ├──────────────────┼─────────────────────┼──────────────┤
587 │"enabled" │ Enabled through a │ │
588 ├──────────────────┤ symlink in .wants │ │
589 │"enabled-runtime" │ directory │ 0 │
590 │ │ (permanently or │ │
591 │ │ just in /run). │ │
592 ├──────────────────┼─────────────────────┼──────────────┤
593 │"linked" │ Made available │ │
594 ├──────────────────┤ through a symlink │ │
595 │"linked-runtime" │ to the unit file │ 1 │
596 │ │ (permanently or │ │
597 │ │ just in /run). │ │
598 ├──────────────────┼─────────────────────┼──────────────┤
599 │"masked" │ Disabled entirely │ │
600 ├──────────────────┤ (permanently or │ 1 │
601 │"masked-runtime" │ just in /run). │ │
602 ├──────────────────┼─────────────────────┼──────────────┤
603 │"static" │ Unit file is not │ 0 │
604 │ │ enabled, and has no │ │
605 │ │ provisions for │ │
606 │ │ enabling in the │ │
607 │ │ "[Install]" │ │
608 │ │ section. │ │
609 ├──────────────────┼─────────────────────┼──────────────┤
610 │"indirect" │ Unit file itself is │ 0 │
611 │ │ not enabled, but it │ │
612 │ │ has a non-empty │ │
613 │ │ Also= setting in │ │
614 │ │ the "[Install]" │ │
615 │ │ section, listing │ │
616 │ │ other unit files │ │
617 │ │ that might be │ │
618 │ │ enabled. │ │
619 ├──────────────────┼─────────────────────┼──────────────┤
620 │"disabled" │ Unit file is not │ 1 │
621 │ │ enabled. │ │
622 ├──────────────────┼─────────────────────┼──────────────┤
623 │"bad" │ Unit file is │ > 0 │
624 │ │ invalid or another │ │
625 │ │ error occured. Note │ │
626 │ │ that is-enabled wil │ │
627 │ │ not actually return │ │
628 │ │ this state, but │ │
629 │ │ print an error │ │
630 │ │ message instead. │ │
631 │ │ However the unit │ │
632 │ │ file listing │ │
633 │ │ printed by │ │
634 │ │ list-unit-files │ │
635 │ │ might show it. │ │
636 └──────────────────┴─────────────────────┴──────────────┘
637
638 mask NAME...
639 Mask one or more unit files, as specified on the command line. This
640 will link these units to /dev/null, making it impossible to start
641 them. This is a stronger version of disable, since it prohibits all
642 kinds of activation of the unit, including enablement and manual
643 activation. Use this option with care. This honors the --runtime
644 option to only mask temporarily until the next reboot of the
645 system. The --now option can be used to ensure that the units are
646 also stopped.
647
648 unmask NAME...
649 Unmask one or more unit files, as specified on the command line.
650 This will undo the effect of mask.
651
652 link FILENAME...
653 Link a unit file that is not in the unit file search paths into the
654 unit file search path. This requires an absolute path to a unit
655 file. The effect of this can be undone with disable. The effect of
656 this command is that a unit file is available for start and other
657 commands although it is not installed directly in the unit search
658 path.
659
660 add-wants TARGET NAME..., add-requires TARGET NAME...
661 Adds "Wants=" resp. "Requires=" dependency to the specified TARGET
662 for one or more units.
663
664 This command honors --runtime in a similar way as enable.
665
666 edit NAME...
667 Edit a drop-in snippet or a whole replacement file if --full is
668 specified, to extend or override the specified unit.
669
670 This creates a drop-in file for a unit. Then, the editor (see the
671 "Environment" section below) is invoked on temporary files which
672 will be written to the real location if the editor exits
673 successfully.
674
675 If --full is specified, this will copy the original units instead
676 of creating drop-in files.
677
678 If --runtime is specified, the changes will be made temporarily in
679 /run and they will be lost on the next reboot.
680
681 If the temporary file is empty upon exit the modification of the
682 related unit is canceled
683
684 After the units have been edited, systemd configuration is reloaded
685 (in a way that is equivalent to daemon-reload).
686
687 Note that this command cannot be used to remotely edit units and
688 that you cannot temporarily edit units which are in /etc since they
689 take precedence over /run.
690
691 get-default
692 Return the default target to boot into. This returns the target
693 unit name default.target is aliased (symlinked) to.
694
695 set-default NAME
696 Set the default target to boot into. This sets (symlinks) the
697 default.target alias to the given target unit.
698
699 Machine Commands
700 list-machines [PATTERN...]
701 List the host and all running local containers with their state. If
702 one or more PATTERNs are specified, only containers matching one of
703 them are shown.
704
705 Job Commands
706 list-jobs [PATTERN...]
707 List jobs that are in progress. If one or more PATTERNs are
708 specified, only jobs for units matching one of them are shown.
709
710 cancel JOB...
711 Cancel one or more jobs specified on the command line by their
712 numeric job IDs. If no job ID is specified, cancel all pending
713 jobs.
714
715 Snapshot Commands
716 snapshot [NAME]
717 Create a snapshot. If a snapshot name is specified, the new
718 snapshot will be named after it. If none is specified, an automatic
719 snapshot name is generated. In either case, the snapshot name used
720 is printed to standard output, unless --quiet is specified.
721
722 A snapshot refers to a saved state of the systemd manager. It is
723 implemented itself as a unit that is generated dynamically with
724 this command and has dependencies on all units active at the time.
725 At a later time, the user may return to this state by using the
726 isolate command on the snapshot unit.
727
728 Snapshots are only useful for saving and restoring which units are
729 running or are stopped, they do not save/restore any other state.
730 Snapshots are dynamic and lost on reboot.
731
732 delete PATTERN...
733 Remove a snapshot previously created with snapshot.
734
735 Environment Commands
736 show-environment
737 Dump the systemd manager environment block. The environment block
738 will be dumped in straight-forward form suitable for sourcing into
739 a shell script. This environment block will be passed to all
740 processes the manager spawns.
741
742 set-environment VARIABLE=VALUE...
743 Set one or more systemd manager environment variables, as specified
744 on the command line.
745
746 unset-environment VARIABLE...
747 Unset one or more systemd manager environment variables. If only a
748 variable name is specified, it will be removed regardless of its
749 value. If a variable and a value are specified, the variable is
750 only removed if it has the specified value.
751
752 import-environment [VARIABLE...]
753 Import all, one or more environment variables set on the client
754 into the systemd manager environment block. If no arguments are
755 passed, the entire environment block is imported. Otherwise, a list
756 of one or more environment variable names should be passed, whose
757 client-side values are then imported into the manager's environment
758 block.
759
760 Manager Lifecycle Commands
761 daemon-reload
762 Reload systemd manager configuration. This will rerun all
763 generators (see systemd.generator(7)), reload all unit files, and
764 recreate the entire dependency tree. While the daemon is being
765 reloaded, all sockets systemd listens on behalf of user
766 configuration will stay accessible.
767
768 This command should not be confused with the reload command.
769
770 daemon-reexec
771 Reexecute the systemd manager. This will serialize the manager
772 state, reexecute the process and deserialize the state again. This
773 command is of little use except for debugging and package upgrades.
774 Sometimes, it might be helpful as a heavy-weight daemon-reload.
775 While the daemon is being reexecuted, all sockets systemd listening
776 on behalf of user configuration will stay accessible.
777
778 System Commands
779 is-system-running
780 Checks whether the system is operational. This returns success when
781 the system is fully up and running, meaning not in startup,
782 shutdown or maintenance mode. Failure is returned otherwise. In
783 addition, the current state is printed in a short string to
784 standard output, see table below. Use --quiet to suppress this
785 output.
786
787 Table 2. Manager Operational States
788 ┌─────────────┬────────────────────────────┐
789 │Name │ Description │
790 ├─────────────┼────────────────────────────┤
791 │initializing │ Early bootup, before │
792 │ │ basic.target is reached or │
793 │ │ the maintenance state │
794 │ │ entered. │
795 ├─────────────┼────────────────────────────┤
796 │starting │ Late bootup, before the │
797 │ │ job queue becomes idle for │
798 │ │ the first time, or one of │
799 │ │ the rescue targets are │
800 │ │ reached. │
801 ├─────────────┼────────────────────────────┤
802 │running │ The system is fully │
803 │ │ operational. │
804 ├─────────────┼────────────────────────────┤
805 │degraded │ The system is operational │
806 │ │ but one or more units │
807 │ │ failed. │
808 ├─────────────┼────────────────────────────┤
809 │maintenance │ The rescue or emergency │
810 │ │ target is active. │
811 ├─────────────┼────────────────────────────┤
812 │stopping │ The manager is shutting │
813 │ │ down. │
814 └─────────────┴────────────────────────────┘
815
816 default
817 Enter default mode. This is mostly equivalent to isolate
818 default.target.
819
820 rescue
821 Enter rescue mode. This is mostly equivalent to isolate
822 rescue.target, but also prints a wall message to all users.
823
824 emergency
825 Enter emergency mode. This is mostly equivalent to isolate
826 emergency.target, but also prints a wall message to all users.
827
828 halt
829 Shut down and halt the system. This is mostly equivalent to start
830 halt.target --irreversible, but also prints a wall message to all
831 users. If combined with --force, shutdown of all running services
832 is skipped, however all processes are killed and all file systems
833 are unmounted or mounted read-only, immediately followed by the
834 system halt. If --force is specified twice, the operation is
835 immediately executed without terminating any processes or
836 unmounting any file systems. This may result in data loss.
837
838 poweroff
839 Shut down and power-off the system. This is mostly equivalent to
840 start poweroff.target --irreversible, but also prints a wall
841 message to all users. If combined with --force, shutdown of all
842 running services is skipped, however all processes are killed and
843 all file systems are unmounted or mounted read-only, immediately
844 followed by the powering off. If --force is specified twice, the
845 operation is immediately executed without terminating any processes
846 or unmounting any file systems. This may result in data loss.
847
848 reboot [arg]
849 Shut down and reboot the system. This is mostly equivalent to start
850 reboot.target --irreversible, but also prints a wall message to all
851 users. If combined with --force, shutdown of all running services
852 is skipped, however all processes are killed and all file systems
853 are unmounted or mounted read-only, immediately followed by the
854 reboot. If --force is specified twice, the operation is immediately
855 executed without terminating any processes or unmounting any file
856 systems. This may result in data loss.
857
858 If the optional argument arg is given, it will be passed as the
859 optional argument to the reboot(2) system call. The value is
860 architecture and firmware specific. As an example, "recovery" might
861 be used to trigger system recovery, and "fota" might be used to
862 trigger a “firmware over the air” update.
863
864 kexec
865 Shut down and reboot the system via kexec. This is mostly
866 equivalent to start kexec.target --irreversible, but also prints a
867 wall message to all users. If combined with --force, shutdown of
868 all running services is skipped, however all processes are killed
869 and all file systems are unmounted or mounted read-only,
870 immediately followed by the reboot.
871
872 switch-root ROOT [INIT]
873 Switches to a different root directory and executes a new system
874 manager process below it. This is intended for usage in initial RAM
875 disks ("initrd"), and will transition from the initrd's system
876 manager process (a.k.a "init" process) to the main system manager
877 process. This call takes two arguments: the directory that is to
878 become the new root directory, and the path to the new system
879 manager binary below it to execute as PID 1. If the latter is
880 omitted or the empty string, a systemd binary will automatically be
881 searched for and used as init. If the system manager path is
882 omitted or equal to the empty string, the state of the initrd's
883 system manager process is passed to the main system manager, which
884 allows later introspection of the state of the services involved in
885 the initrd boot.
886
887 suspend
888 Suspend the system. This will trigger activation of the special
889 suspend.target target.
890
891 hibernate
892 Hibernate the system. This will trigger activation of the special
893 hibernate.target target.
894
895 hybrid-sleep
896 Hibernate and suspend the system. This will trigger activation of
897 the special hybrid-sleep.target target.
898
899 Parameter Syntax
900 Unit commands listed above take either a single unit name (designated
901 as NAME), or multiple unit specifications (designated as PATTERN...).
902 In the first case, the unit name with or without a suffix must be
903 given. If the suffix is not specified, systemctl will append a suitable
904 suffix, ".service" by default, and a type-specific suffix in case of
905 commands which operate only on specific unit types. For example,
906
907 # systemctl start sshd
908
909 and
910
911 # systemctl start sshd.service
912
913 are equivalent, as are
914
915 # systemctl isolate default
916
917 and
918
919 # systemctl isolate default.target
920
921 Note that (absolute) paths to device nodes are automatically converted
922 to device unit names, and other (absolute) paths to mount unit names.
923
924 # systemctl status /dev/sda
925 # systemctl status /home
926
927 are equivalent to:
928
929 # systemctl status dev-sda.device
930 # systemctl status home.mount
931
932 In the second case, shell-style globs will be matched against currently
933 loaded units; literal unit names, with or without a suffix, will be
934 treated as in the first case. This means that literal unit names always
935 refer to exactly one unit, but globs may match zero units and this is
936 not considered an error.
937
938 Glob patterns use fnmatch(3), so normal shell-style globbing rules are
939 used, and "*", "?", "[]" may be used. See glob(7) for more details. The
940 patterns are matched against the names of currently loaded units, and
941 patterns which do not match anything are silently skipped. For example:
942
943 # systemctl stop sshd@*.service
944
945 will stop all sshd@.service instances.
946
947 For unit file commands, the specified NAME should be the full name of
948 the unit file, or the absolute path to the unit file:
949
950 # systemctl enable foo.service
951
952 or
953
954 # systemctl link /path/to/foo.service
955
956
958 On success, 0 is returned, a non-zero failure code otherwise.
959
961 $SYSTEMD_EDITOR
962 Editor to use when editing units; overrides $EDITOR and $VISUAL. If
963 neither $SYSTEMD_EDITOR nor $EDITOR nor $VISUAL are present or if
964 it is set to an empty string or if their execution failed,
965 systemctl will try to execute well known editors in this order:
966 nano(1), vim(1), vi(1).
967
968 $SYSTEMD_PAGER
969 Pager to use when --no-pager is not given; overrides $PAGER.
970 Setting this to an empty string or the value "cat" is equivalent to
971 passing --no-pager.
972
973 $SYSTEMD_LESS
974 Override the default options passed to less ("FRSXMK").
975
977 For examples how to use systemctl in comparsion with old service and
978 chkconfig command please see: Managing System Services[2]
979
981 systemd(1), journalctl(1), loginctl(1), machinectl(1), systemd.unit(5),
982 systemd.resource-control(5), systemd.special(7), wall(1),
983 systemd.preset(5), systemd.generator(7), glob(7)
984
986 1. Preset
987 http://freedesktop.org/wiki/Software/systemd/Preset
988
989 2. Managing System Services
990 https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/System_Administrators_Guide/sect-Managing_Services_with_systemd-Services.html
991
992
993
994systemd 219 SYSTEMCTL(1)