1. Managing & Listing Services
💡 Usereloadoverrestartfor nginx/postgres in production — it avoids dropping connections.
💡 Reading the output columns:
Column Meaning UNITService name (e.g. nginx.service)LOADWhether systemd parsed the unit file ACTIVEHigh-level state: active,inactive,failedSUBLow-level state: running,exited,deadDESCRIPTIONHuman-readable label
2. Debugging & Logs
3. Boot & Startup Behavior
4. Writing a Custom .service File
Step 1 — Create the file:
Quick Reference Summary
| Task | Command |
|---|---|
| Check service status | systemctl status <name> |
| Start service | sudo systemctl start <name> |
| Stop service | sudo systemctl stop <name> |
| Restart service | sudo systemctl restart <name> |
| Enable on boot | sudo systemctl enable <name> |
| Disable on boot | sudo systemctl disable <name> |
| View logs live | journalctl -u <name> -f |
Reload after .service edit | sudo systemctl daemon-reload |
| List running services | systemctl list-units --type=service --state=running |
| List failed services | systemctl list-units --state=failed |
| Filter services by name | systemctl list-units --type=service | grep <keyword> |