Skip to content

Linux - Systemd

Commands

Services

Services status:

systemctl list-unit-files --type=service
systemctl list-unit-files --type=service --state=enabled

Mask service (Lock):

systemctl mask {service} --now

Show environment vars:

systemctl show-environment

Set environment var:

systemctl set-environment {key}={value}
# Ex: systemctl set-environment no_proxy=localhost

Targets

Get default target:

systemctl get-default

Set default target:

systemctl set-default {target}
# Ex: systemctl set-default graphical.target
#      -> Create symlink: /etc/systemd/system/default.target
Back to top