System Administration

systemctl

Control the systemd system and service manager daemons.

COMMAND SYNTAX
$ systemctl [command] [service_name]

Common Options & Flags

Option / FlagDescription
statusShow runtime status of service
start / stop / restartStart, stop, or restart a service
enable / disableEnable or disable service auto-start at boot
daemon-reloadReload systemd manager configuration

Practical Command Examples

$ systemctl status nginx

Check if Nginx web server is running and view recent logs.

$ systemctl restart docker

Restart Docker daemon service.

$ systemctl enable --now firewall

Enable firewall auto-boot and start immediately.

Production Real-World Use Case

Managing web server, database, and background worker daemons on Linux production servers.

Common Mistakes

  • ✕Forgetting systemctl daemon-reload after editing unit files in /etc/systemd/system/.

Security Considerations

Audit enabled boot services with systemctl list-unit-files --state=enabled to eliminate unnecessary attack surfaces.