systemctl vs systemd vs service — What’s the Difference?
On modern Linux systems, you’ll often see references to systemd
, systemctl
, and service
. Here’s a concise breakdown of what each does, their roles, and when to use them.
systemd
✅ What it is
A system and service manager for Linux, designed to unify service behavior across distributions. It replaces older init systems (like SysV init) and is responsible for managing the entire system lifecycle — from boot to shutdown.
✅ Key Role
- It’s the first process started by the Linux kernel (
PID 1
) and manages the whole system. - Handles services (units), sockets, mount points, and more.
✅ Configuration Files
- System unit files:
/etc/systemd/system/*.service
(custom) - Package unit files:
/lib/systemd/system/*.service
systemctl
✅ What it is
The main command-line interface for interacting with systemd
.
✅ Key Role
- Allows you to control and manage
systemd
units (services, sockets, timers, etc.). - Common actions: start, stop, enable, disable, and get status of units.
✅ Example Commands
systemctl start nginx
systemctl status sshd
systemctl enable apache2
service
✅ What it is
A legacy command that originated from SysV init to manage services.
✅ Key Role
- Provides a consistent way to start, stop, and check the status of services, even across different init systems.
✅ Example Commands
service nginx start
service ssh status
On modern systems using systemd
, service
often acts as a compatibility layer and internally redirects to systemctl
commands.
Summary Table
Name | Type | Usage Purpose |
---|---|---|
systemd | Init system, manager | Manages the entire system and services |
systemctl | Command-line interface | Interacts with systemd to manage units |
service | Compatibility wrapper | Legacy interface for service management |
Final Tips
- On modern Linux systems, prefer using
systemctl
for full feature access and better control. - Use
service
only if you’re working with legacy scripts or older environments.