Linux service vs systemctl: Understanding Old and Modern Service Management
A practical guide to managing Linux services, troubleshooting legacy systems, and understanding what happens under the hood.
Introduction: Why Does Linux Have Two Commands for the Same Job?
Imagine you’re learning Linux and encounter this command:
service apache2 statusThen, in another tutorial, you see:
systemctl status apache2Both commands appear to perform the same task: checking whether Apache is running.
So, what’s the difference?
Is service deprecated? Is systemctl its replacement? And what happens when you're working with an older Linux distribution like Metasploitable 2, where systemctl might not even exist?
These questions are more important than they seem.
Understanding Linux service management isn’t just about memorizing commands. It’s about understanding how Linux starts, manages, monitors, and controls background processes.
In this article, we’ll explore both commands, their historical differences, practical applications, and how to troubleshoot services when traditional management tools fail.
1. What Is a Linux Service?
A Linux service is a program that runs in the background to provide functionality to the operating system or other applications.
Unlike a regular application that you launch and interact with directly, a service typically operates without requiring continuous user interaction.
Examples include:
Service Function
Apache Hosts websites and web applications
SSH Provides remote system access
MySQL Database management
Cron Executes scheduled tasks
Docker Manages containers
NetworkManager Manages network connectionsThink of a service like a generator.
You need to start it, stop it, restart it, or check whether it’s running.
Linux provides commands to perform these operations.
2. The Traditional Approach: service
Before systemd became widely adopted, Linux distributions commonly used SysV init for system initialization and service management.
The traditional service command follows this syntax:
service <service-name> <action>For example:
service apache2 statusThis checks Apache’s status.
Other operations include:
service apache2 start
service apache2 stop
service apache2 restart
service apache2 reloadUnderstanding the commands
start— Starts the service.stop— Stops the service.restart— Stops and starts the service again.reload— Requests that the service reload its configuration.status— Displays the service's current state.
The service command is considered a legacy interface, but it has not disappeared. Many modern distributions retain it for compatibility.
3. The Modern Approach: systemctl
Enter systemctl, the command-line utility used to interact with systemd.
Systemd is an init system and service manager used by many modern Linux distributions, including Ubuntu, Debian, Fedora, and Kali Linux.
Its general syntax is:
systemctl <action> <unit>For example:
systemctl status apache2Notice the difference:
service apache2 statusCompared with:
systemctl status apache2The command structure changes, but the objective is similar.
Common systemctl commands
sudo systemctl start apache2
sudo systemctl stop apache2
sudo systemctl restart apache2
sudo systemctl reload apache2
sudo systemctl status apache2When checking the status, you might encounter:
● apache2.service - The Apache HTTP Server
Loaded: loaded
Active: active (running)The most important line is:
Active: active (running)This indicates that systemd considers the Apache service active.
Other possible states include:
inactive (dead)— The service is not currently active.failed— The service encountered a failure.activating— The service is in the process of starting.
4. The Difference Between start and enable
This is one of the most misunderstood concepts in Linux service management.
Consider:
sudo systemctl start apache2This starts Apache immediately.
However, it does not necessarily configure Apache to start automatically after a system reboot.
For that, we use:
sudo systemctl enable apache2This configures the service to start automatically during boot, according to its systemd configuration.
We can combine both operations:
sudo systemctl enable --now apache2This enables Apache at boot and starts it immediately.
What about disable and stop?
These commands are also different:
sudo systemctl stop apache2Stops Apache now.
sudo systemctl disable apache2Removes its automatic startup configuration.
Disabling a service does not necessarily stop an already-running instance.
CommandPurposestartStart nowstopStop nowrestartStop and start againreloadReload configurationenableEnable automatic startupdisableDisable automatic startupenable --nowEnable and start immediately
5. Reload vs Restart: Are They the Same?
No.
Suppose you modify Apache’s configuration file.
You have two common options:
sudo systemctl restart apache2Or:
sudo systemctl reload apache2A restart stops and starts the service again.
A reload asks the running service to reread its configuration without a full service restart, if supported.
RESTARTApache
↓
Stop
↓
Start againRELOADApache continues running
↓
Reads updated configuration
↓
Continues operatingFor configuration changes, reload can reduce interruption, but always confirm that the service supports it and that the configuration is valid.
6. Why Did Linux Move From SysV Init to systemd?
Historically, Linux distributions used different initialization systems.
One traditional approach was SysV init.
Service scripts were commonly stored in:
/etc/init.d/For example:
/etc/init.d/
├── apache2
├── ssh
├── mysql
└── networkingThese scripts were used to start, stop, and manage services.
Get Adefemi Oluwaseun (whoami)’s stories in your inbox
Join Medium for free to get updates from this writer.
As Linux systems evolved, systemd gained widespread adoption.
Modern systemd-based systems manage units such as:
apache2.service
ssh.service
cron.service
NetworkManager.serviceThe systemctl command provides an interface for managing these units.
Importantly, systemd does more than manage services. It also handles other unit types, including:
Unit Purpose
.service Services
.socket Socket activation
.timer Scheduled activation
.mount Filesystem mount points
.target Groups of unitsThis is why systemctl is more than a simple replacement for service.
7. Is the service Command Deprecated?
The accurate explanation is:
service is an older service-management interface, while systemctl is the modern, generally preferred interface on systemd-based Linux systems.
However, saying that service is completely deprecated everywhere would be inaccurate.
On many modern Debian-based distributions, service remains available for backward compatibility and may delegate operations to systemd.
Conceptually:
service apache2 status
|
v
Compatibility interface
|
v
systemd
|
v
apache2.serviceWhereas:
systemctl status apache2
|
v
systemd
|
v
apache2.serviceFor modern Linux administration, learn systemctl first, but understand service because it remains relevant when working with older systems and scripts.
8. Practical Linux Lab: Managing Apache
Let’s apply what we’ve learned.
First, install Apache on a Debian-based system:
sudo apt update
sudo apt install apache2Check its status:
systemctl status apache2Stop it:
sudo systemctl stop apache2Check its status again:
systemctl status apache2Start it:
sudo systemctl start apache2Enable automatic startup:
sudo systemctl enable apache2Check whether it’s enabled:
systemctl is-enabled apache2Check whether it’s currently active:
systemctl is-active apache2Remember:
is-enabled
|
v
Is it configured to start at boot?is-active
|
v
Is it currently active?These are two different questions.
9. What Happens When You’re Working With Metasploitable 2?
Here’s where Linux history becomes particularly useful for cybersecurity learners.
Metasploitable 2 is an intentionally vulnerable Linux virtual machine used for penetration testing education.
Because it is based on an older Ubuntu environment, it uses the traditional SysV init architecture rather than systemd.
If you run:
systemctl status apache2You may receive:
systemctl: command not foundThis doesn’t automatically mean something is wrong with your installation.
It means the system may not have systemd or its command-line utility.
Try:
service apache2 statusIf necessary, use the traditional init script directly:
/etc/init.d/apache2 statusTo view available service scripts:
ls /etc/init.d/This is one reason cybersecurity professionals should understand both modern and legacy Linux environments.
10. What If Both service and systemctl Fail?
Sometimes, you need to investigate beyond the service manager.
Instead of immediately concluding that a service is down, check the actual process.
Method 1: ps
ps aux | grep '[a]pache2'This searches for Apache processes.
Method 2: pidof
pidof apache2If Apache is running, this may return one or more process IDs (PIDs).
Method 3: pgrep
pgrep -a apache2This displays matching process IDs and command lines.
Method 4: netstat
On older Linux systems:
netstat -tulpnTo check HTTP port 80:
netstat -tulpn | grep ':80'On modern systems, you can use:
ss -tulpnFor SSH:
ss -tulpn | grep ':22'For MySQL:
ss -tulpn | grep ':3306'A listening port provides evidence that a process is accepting connections on that port. However, a listening port alone doesn’t prove that the application is healthy or functioning correctly.
11. My Linux Service Troubleshooting Cheat Sheet
When checking a service, use this general approach:
CHECK SERVICE
|
+----------+----------+
| |
Modern OS Legacy OS
| |
systemctl service
| |
| /etc/init.d/
| |
+----------+----------+
|
Check process
|
+--------+--------+
| | |
ps pgrep pidof
|
Check port
|
ss / netstatThis approach is useful when troubleshooting Linux servers, cybersecurity labs, CTF environments, and older virtual machines.
Final Thoughts
Linux service management is a perfect example of why understanding the underlying technology matters more than memorizing commands.
The key differences are:
service— Traditional/legacy service-management interface.systemctl— Modern command-line interface for systemd./etc/init.d/— Traditional SysV init service scripts.ps,pgrep, andpidof— Tools for checking processes.ssandnetstat— Tools for inspecting network sockets and listening ports.
For modern Linux systems that use systemd, make systemctl your primary tool.
But when working with older systems like Metasploitable 2, knowing the legacy approach can save you considerable troubleshooting time.
Don’t just memorize commands. Understand what is happening underneath them.
That is how you move from being someone who uses Linux commands to someone who understands Linux.
Continue Learning
If you’re learning Linux for cybersecurity, practice these commands in Kali Linux, Ubuntu, and Metasploitable 2.
Build your understanding through hands-on exercises:
Learn → Practice → Troubleshoot → Document → Repeat.
Follow me for more practical Linux, cybersecurity, ethical hacking, and security research tutorials.






