Notes to Self

Alex Sokolsky's Notes on Computers and Programming

systemctl

systemctl is a cli to systemd. Reasonable intro.

The pager defaults to less. To disable it use --no-pager or export SYSTEMD_PAGER=.

How to manage systemd units with systemctl

Related: journalctl

Unit Types

To list the unit (daemon) types:

$ systemctl -t help
Available unit types:
service
mount
swap
socket
target
device
automount
timer
path
slice
scope
Unit Type File Extension Description
Device .device A device file recognized by the kernel.
Mount .mount A file system mount point.
Service .service A service on the system, including instructions for starting, restarting, and stopping the service.
Socket .socket A network socket associated with a service.
Swap .swap A swap device or a swap file.
Target .target It replaces sysV init run levels that control system boot.
Timer .timer A systemd timer.

Types of Daemons

There are 3 types of daemons:

To see the system’s processes in each:

systemctl
systemctl list-units --type service
systemctl list-units --type=service
systemctl list-units --type=socket --state=LOAD
systemctl list-units --type=path --all
systemctl list-unit-files

e.g.

systemctl

Also check out:

systemctl list-unit-files

Working with Services

Working with Sockets

Working with Mounts

Working with Targets

Working with Timers