Technotes for future me


Managing services with systemctl

List servicessystemctl list-units --type service
Query SERVICE statussudo systemctl status SERVICE.service
List failed services on bootsudo systemctl --failed
Start SERVICEsudo systemctl start SERVICE.service
Stop SERVICEsudo systemctl stop SERVICE.service
Restart SERVICEsudo systemctl restart SERVICE.service
Kill SERVICE (all processes) with SIGTERMsudo systemctl kill SERVICE.service
Kill SERVICE (all processes) with SIGKILLsudo systemctl kill -s SIGKILL SERVICE.service
Start SERVICE on bootsudo systemctl enable SERVICE.service
Don’t start SERVICE on bootsudo systemctl disable SERVICE.service


Run with root privileges (sudo)

Go to single user modesystemctl rescue
Go to multi-user modesystemctl isolate
(= old runlevel 3)systemctl isolate
Go to graphical levelsystemctl isolate
Get default runlevelsystemctl get-default
Set default runlevelsystemctl set-default
Shutdownsystemctl poweroff
Reboot, suspend, hibernatesystemctl STATE


Last updated on 31 Jan 2021
Published on 28 Mar 2020
Edit on GitHub