systemctl
controls the systemd system and service manager. systemctl
must not to be confused with sysctl
. systemctl [OPTIONS…] COMMAND [UNIT…]
UNIT
specifies a (single) unit name while PATTERN…
specifies multiple units. systemctl
appends a suitable suffix (typically .service
but type specific suffixes are possible). systemctl start sshd systemctl start sshd.service
systemctl isolate default systemctl isolate default.target
systemctl status /dev/sda systemctl status dev-sda.device
list-units [PATTERN…] | Compare with list-unit-files |
list-automounts [PATTERN…] | |
list-sockets [PATTERN…] | |
list-timers [PATTERN…] | |
is-active PATTERN… | |
is-failed PATTERN… | |
status [PATTERN…|PID…]] | |
show [PATTERN…|JOB…] | Show properties of units, jobs or the manager itself. Compare with set-property |
cat PATTERN… | |
help PATTERN…|PID… | |
list-dependencies [UNIT…] | |
start PATTERN… | Start the specified units (i. e. activate them) |
stop PATTERN… | |
reload PATTERN… | |
restart PATTERN… | |
try-restart PATTERN… | |
reload-or-restart PATTERN… | |
try-reload-or-restart PATTERN… | |
isolate UNIT | |
kill PATTERN… | |
clean PATTERN… | |
freeze PATTERN… | |
thaw PATTERN… | |
set-property UNIT PROPERTY=VALUE… | Compare with show and the -p (or --property ) options. |
bind UNIT PATH [PATH] | |
mount-image UNIT IMAGE [PATH [PARTITION_NAME:MOUNT_OPTIONS]] | |
service-log-level SERVICE [LEVEL] | |
service-log-target SERVICE [TARGET] | |
reset-failed [PATTERN…] |
list-unit-files [PATTERN…] | Compare with list-units |
enable UNIT… , enable PATH… | Enables the specified units by creating symlinks as specified in the [Install] sections of the corresponding unit files. |
disable UNIT… | Disables the specified unit. |
reenable UNIT… | |
preset UNIT… | |
preset-all | |
is-enabled UNIT… | Check if a unit is enabled. |
mask UNIT… | |
unmask UNIT… | |
link PATH… | |
revert UNIT… | |
add-wants TARGET UNIT… , add-requires TARGET UNIT… | |
edit UNIT… | |
get-default | Returns the target (unit name default.target ) into which the system is booted by default. (Apparently, if the Kernel command line contains single (and also other words?), the default can be or is overrwritten) |
set-default TARGET |
list-machines [PATTERN…]
. list-jobs [PATTERN…] | |
cancel JOB… |
systemd supports an environment block that is passed to processes the manager spawns. The names of the variables can contain ASCII letters, digits, and the underscore character. Variable names cannot be empty or start with a digit. In variable values, most characters are allowed, but the whole sequence must be valid UTF-8. (Note that control characters like newline (NL), tab (TAB), or the escape character (ESC), are valid ASCII and thus valid UTF-8). The total length of the environment block is limited to _SC_ARG_MAX value defined by sysconf(3).
show-environment | |
set-environment VARIABLE=VALUE… | |
unset-environment VARIABLE… | |
import-environment VARIABLE… |
daemon-reload | |
daemon-reexec | |
log-level [LEVEL] | |
log-target [TARGET] | |
service-watchdogs [yes|no] |
is-system-running | |
default | |
rescue | |
emergency | |
halt | |
poweroff | |
reboot | |
kexec | |
exit [EXIT_CODE] | |
switch-root ROOT [INIT] | |
suspend | Triggers the target unit system.target in order to suspends the system. |
hibernate | TODO: Requires enough swap space, apparently |
hybrid-sleep | |
suspend-then-hibernate |
-t | --type= | Restricts command to the indicated (comma separated list) unit type. |
--state= | ||
-p | --property= | See also the set-property and show commands. |
-P | ||
-a | --all | |
-r | --recursive | |
--reverse | ||
--after | ||
--before | ||
--with-dependencies | ||
-l | --full | |
--value | ||
--show-types | ||
--job-mode= | ||
-T | --show-transaction | |
--fail | ||
--check-inhibitors= | ||
-i | Shortcut for --check-inhibitors=no . | |
--dry-run | ||
-q | --quiet | |
--no-warn | ||
--no-block | ||
--wait | ||
--user | ||
--system | ||
--failed | ||
--no-wall | ||
--global | ||
--no-reload | ||
--no-ask-password | ||
--kill-whom= | ||
-s | --signal= | |
--what= | ||
-f | --force | |
--message= | ||
--now | ||
--root= | ||
--image=image | ||
--runtime | ||
--preset-mode= | ||
-n | --lines= | |
-o | --output= | |
--firmware-setup | ||
--boot-loader-menu=timeout | ||
--boot-loader-entry=ID | ||
--reboot-argument= | ||
--plain | ||
--timestamp= | ||
--mkdir | ||
--marked | ||
--read-only | ||
-H | --host= | |
-M | --machine= | |
--no-pager | ||
--legend=BOOL | ||
-h | --help | |
--version |
systemctl
reads name.service
files. These files define how and when services (daemons) should be started. /usr/lib/systemd/system
. (Possibly also in /run/systemd/system
or /etc/systemd/system
). systemctl enable avahi-daemon.service
systemctl start avahi-daemon.service
systemctl status
shows the system status.