An Introduction to Managing a Linux Server with systemd

Posted on by Helpful Humans of Liquid Web | Updated:
Reading Time: 2 minutes

Systemd is an init system used by several common Linux Distributions which has gained popularity since 2015. A Linux init system is the first process or daemon started on a system after the initial boot process, and manages services, daemons, and other system processes. Systemd is composed of unit files that contain the initialization instructions for the daemons which it controls. While many portions of a system can be managed with systemd, this article will focus on managing services.

How to Manage a Linux Server with systemd

To control services with systemd, the systemctl command is used. Let’s go over how to start, stop, restart, enable and disable, and check the status of a service. We’ll use the Apache Service, known as httpd on RedHat Based Linux distributions as an example.

Unless there is a failure running some of these commands, they will not output any results, this is expected. Commands expected to have output will be noted.


This will only start a service one time, if you want the service to be started on boot, see the “Enable on Boot” command below.

systemctl start httpd


This will only stop a service one time, if you want the service to not be restarted on boot, see the Disable on Boot command below.

systemctl stop httpd


Fully stops and starts a service.

systemctl restart httpd


Reloads a service’s configuration without causing the service to restart. Not all services accept that reload command.

systemctl reload httpd

Enable on Boot

This will set the specified service to start up every time a system is booted up.

systemctl enable httpd

Example output:

Created symlink from /etc/systemd/system/ to /etc/systemd/system/httpd.service.

Disable on Boot

This will set the specified service to not start up every time a system is booted up.

systemctl disable httpd

Example output:

Removed symlink /etc/systemd/system/

Check Status

systemctl status httpd

Example output:

● httpd.service - Apache web server managed by cPanel EasyApache
   Loaded: loaded (/etc/systemd/system/httpd.service; enabled; vendor preset: disabled)
   Active: active (running) since Fri 2018-01-26 13:32:15 EST; 20h ago
 Main PID: 2988 (httpd)
   CGroup: /system.slice/httpd.service
           ├─ 2988 /usr/sbin/httpd -k start
           ├─30142 /usr/sbin/httpd -k start
           ├─30143 /usr/local/cpanel/3rdparty/bin/perl /usr/local/cpanel/bin/leech...
           ├─30144 /usr/sbin/httpd -k start
           ├─30145 /usr/sbin/httpd -k start
           ├─30219 /usr/sbin/httpd -k start
           ├─30220 /usr/sbin/httpd -k start
           └─30221 /usr/sbin/httpd -k start

Jan 26 13:32:15 systemd[1]: Starting Apache web server managed ....
Jan 26 13:32:15 systemd[1]: PID file /run/apache2/ not....
Jan 26 13:32:15 systemd[1]: Started Apache web server managed b....
Hint: Some lines were ellipsized, use -l to show in full.

One of the main points of this output are the third line, in this case showing Active: active (running), this shows that the service is presently started and active.

More Information

More information on using systemctl, and other portions of systemd can be found in several Linux manual pages, primarily systemctl(1).

Here’s a short example of the command to view the manual page, and the first few lines of that page.

man 1 systemctl
SYSTEMCTL(1)                  systemctl                 SYSTEMCTL(1)

       systemctl - Control the systemd system and service manager

       systemctl [OPTIONS...] COMMAND [NAME...]

       systemctl may be used to introspect and control the state of
       the "systemd" system and service manager. Please refer to
       systemd(1) for an introduction into the basic concepts and
       functionality this tool manages.

About the Author: Helpful Humans of Liquid Web

Latest Articles

How to Install MySQL on Windows Server 2019

Read Article

How to Set Up a Cron Job in cPanel

Read Article

What Is Puppet Software and How Do You Use It?

Read Article

Accessing Man Pages on Ubuntu 16.04 LTS

Read Article

What is VMware Fusion?

Read Article