⚙️ Checking Running Services
Think of services like ongoing operations in your office: security cameras, printers, coffee machines, or a receptionist. They need to be running properly for your system (office) to function smoothly. Linux has systemd to manage services, and older systems may use the service command.
Using systemctl (modern systems)
systemctl controls and checks systemd services.
Common commands:
1. Check status of a service:
Shows if the service is active, inactive, or failed and provides logs and process ID.
2. Start a service:
Boots up a service if it's stopped.
3. Stop a service:
4. Enable/Disable at boot:
# starts on boot
# won't start on boot
Using service (older systems)
The service command is similar to systemctl but uses older syntax.
# check status
# start service
# stop service
Practical Tips
If a web server or database isn't responding, always check its service status first. Use systemctl list-units --type=service to see all running services at once. Logs for a service can often be viewed via:
Real-life analogy
For systemctl: Like the office manager who can start, stop, or check the status of any ongoing operation. For service: Like an old-school manager. Services are like ongoing office operations that need supervision. This wraps up System Monitoring and Logs. You now have tools to check CPU, memory, and disk health; view system logs for troubleshooting; monitor disk I/O and memory usage; and inspect and control running services.