Process Management with systemd
Intermediate10 min
Manage services and processes using systemd, including starting, stopping, enabling, and debugging service units.
Prerequisites
- -Linux with systemd
- -Root or sudo access
Steps
1
List running services
View all active services and their status.
$ systemctl list-units --type=service --state=running
2
Check a specific service status
View detailed status including PID, memory usage, and recent logs.
$ systemctl status nginx
3
View failed services
List all services that have failed to start.
$ systemctl list-units --type=service --state=failed
Use 'systemctl reset-failed' to clear the failed state after investigating.
4
Enable a service to start on boot
Configure a service to start automatically when the system boots.
$ sudo systemctl enable --now nginx
The --now flag starts the service immediately in addition to enabling it for boot.
5
View service dependencies
See what a service depends on and what depends on it.
$ systemctl list-dependencies nginx
Full Script
FAQ
Discussion
Loading comments...