Systemd: Daily Service Commands

Linux

Systemd: Daily Service Commands

Service control

CommandAction
sudo systemctl start nginxStart service
sudo systemctl stop nginxStop service
sudo systemctl restart nginxRestart service
sudo systemctl reload nginxReload configuration
systemctl status nginxShow detailed status

Boot and enablement

CommandAction
sudo systemctl enable nginxEnable at boot
sudo systemctl disable nginxDisable at boot
systemctl is-enabled nginxCheck enablement

Logs

CommandAction
journalctl -u nginx -n 100Last 100 lines
journalctl -u nginx -fFollow logs live

Tip

After editing a unit file, run sudo systemctl daemon-reload before restarting the service.