systemctl — managing systemd services
cheat sheet · Ubuntu 24.04 · systemd 255 https://lab.dimsanych.ru/en/wiki/systemctl/Cheat sheet
-
systemctl status nginx --no-pagerstate, no pager -
sudo systemctl status nginx+ the last journal lines -
systemctl start nginxstart it now -
systemctl stop nginxstop it now -
systemctl restart nginxrestart it (drops connections) -
systemctl enable --now nginxenable autostart and start it right away -
systemctl cat nginx --no-pagerthe whole unit file -
systemctl edit nginxopen a drop-in override -
sudo systemctl daemon-reloadreread units after an edit -
systemctl --failedlist of failed units -
sudo journalctl -xeu nginxwhy the unit failed
Options
enable and start are independent operations: enable only registers
the unit for autostart, it doesn't touch the current session's service,
so after enable without --now the service stays inactive until reboot
or an explicit start. The reverse is also true: start without
enable won't survive a reboot.