systemctl

Control systemd services and system

TLDR

Show all running services
$ systemctl status
List failed units
$ systemctl --failed
Start/Stop/Restart a service
$ systemctl start|stop|restart unit
Enable/Disable a service at boot
$ systemctl enable|disable unit
Reload systemd configuration
$ systemctl daemon-reload
Check if a unit is active/enabled/failed
$ systemctl is-active|is-enabled|is-failed unit
List all service units by state
$ systemctl list-units -t service --state running
Show contents of a unit file
$ systemctl cat unit

SYNOPSIS

systemctl [OPTIONS...] COMMAND [UNIT...]

DESCRIPTION

systemctl controls the systemd system and service manager. It can be used to introspect and control the state of the systemd system, manage services, check unit dependencies, and perform system operations like reboot or shutdown.

PARAMETERS

-t, --type=TYPE

Filter by unit type (service, socket, target, mount, timer, etc.)
--state=STATE
Filter by unit state (active, inactive, failed, running, etc.)
-a, --all
Show all units including inactive ones
--user
Manage user services instead of system services
--no-block
Return immediately without waiting for operation to complete
--now
Combine enable/disable with start/stop
--force
Override safety checks or symlink conflicts
-q, --quiet
Suppress output
-n, --lines=NUM
Number of journal lines to show with status
--no-pager
Do not pipe output into a pager
-o, --output=FORMAT
Control journal output format (short, verbose, json, etc.)

COMMON COMMANDS

list-units: List active or specified unitslist-unit-files: Show installed unit files and their enablement statestatus: Show runtime status and recent logsstart/stop: Start or stop unitsrestart: Stop then start unitsreload: Reload unit configuration without stoppingenable/disable: Enable or disable unit activation at bootmask/unmask: Completely disable or re-enable a unitedit: Edit unit file with drop-in snippetscat: Show contents of unit fileshow: Display unit properties in machine-readable formatdaemon-reload: Reload systemd configuration and unit filesis-active/is-enabled/is-failed: Check unit statekill: Send signal to unit processespoweroff/reboot/halt: System power commandssuspend/hibernate: Enter sleep states

INSTALL

sudo apt install systemd
sudo dnf install systemd
sudo pacman -S systemd
sudo zypper install systemd
brew install systemd
nix profile install nixpkgs#systemd

CAVEATS

Some commands require root privileges. The --user flag manages per-user services in ~/.config/systemd/user/. Use daemon-reload after modifying unit files. Masked units cannot be started even manually.

HISTORY

systemctl is part of systemd, introduced in 2010 by Lennart Poettering. It replaced traditional SysV init scripts and service management tools like service and chkconfig.

SEE ALSO

journalctl(1), service(8)