Oracle Linux Basic Administration Series - Part 6 - How to Manage Services Using systemctl in Oracle Linux
- Jason Beattie
- 19 hours ago
- 2 min read
Modern Oracle Linux systems use systemd as their default system and service manager. The systemctl command is your main tool to control services - starting, stopping, enabling, and checking their status.
In this blog, you’ll learn how to use systemctl effectively to manage services and system states.
Step 1: Understanding systemd and systemctl
systemd is the system and service manager that replaced older init systems. It’s responsible for:
Starting services during boot
Managing service dependencies
Handling background daemons and timers
Logging events
systemctl is the command-line utility for interacting with systemd.
Step 2: Checking Service Status
To check whether a service is running:
systemctl status servicenameExample:
sudo systemctl status sshd
Output:
● sshd.service - OpenSSH server daemon
Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled)
Active: active (running)Key fields:
Loaded: service file exists and is recognized
Active: shows whether it’s running
Enabled: means it starts automatically on boot
Step 3: Starting and Stopping Services
Start a service:
sudo systemctl start servicenameStop a service:
sudo systemctl stop servicenameRestart a service:
sudo systemctl restart servicenameReload service configuration (without stopping it):
sudo systemctl reload servicenameExample:

Step 4: Enabling and Disabling Services at Boot
To start a service automatically at boot:
sudo systemctl enable servicenameTo disable auto-start:
sudo systemctl disable servicenameTo check if a service is enabled:
systemctl is-enabled servicenameExample:

Step 5: Viewing All Services
List all running services:
systemctl list-units --type=service --state=running
List all (active/inactive):
systemctl list-units --type=service
List all installed services (even inactive):
systemctl list-unit-files --type=service
Step 6: Analyzing Service Logs
You can view logs for a specific service using journalctl:
sudo journalctl -u servicenameExample:

To see only recent entries:
sudo journalctl -u sshd -n 20
To continuously monitor logs (like tail -f):
sudo journalctl -u sshd -fStep 7: Reloading the systemd Daemon
If you edit a service file manually, reload systemd to apply changes:
sudo systemctl daemon-reloadThen restart the service:
sudo systemctl restart servicenameStep 8: Masking and Unmasking Services
Masking prevents a service from being started manually or automatically.
To mask a service:
sudo systemctl mask servicenameTo unmask:
sudo systemctl unmask servicenameExample:
sudo systemctl mask httpd
Step 9: Check System Boot Performance
You can analyze boot time and identify slow services using:
systemd-analyze
To see detailed breakdowns:
systemd-analyze blame
Step 10: Rebooting and Power Management
systemctl can also control the system state.
Conclusion
You now know how to manage services on Oracle Linux using systemctl. This skill helps you control system processes, troubleshoot issues, and ensure your server behaves exactly as you expect.
In the next post, we’ll learn how to monitor system performance and resources, a crucial part of maintaining a healthy Oracle Linux environment.



Comments