On Systemd Linux systems such as RHEL 8 / CentOS 8 it is possible to enable and disable services to start on boot with a single
In this tutorial you will learn:
- How to enable service to start on boot.
- How to list all services on systemd Linux system.
Software Requirements and Conventions Used
|Category||Requirements, Conventions or Software Version Used|
|System||Red Hat Enterprise Linux 8, CentOS 8|
|Other||Privileged access to your Linux system as root or via the
# – requires given linux commands to be executed with root privileges either directly as a root user or by use of
$ – requires given linux commands to be executed as a regular non-privileged user
How to start service on boot with RHEL 8 / CentOS 8 Linux step by step instructions
- Obtain the service name you wish to enable to start on boot.
There are many ways on how to accomplish this task. Perhaps the simplest solution is to list all currently disabled services using the
# systemctl list-unit-files --state=disabled
The above command will create a long list of disabled services. Scroll through the list to find the service you wish to enable and take a note of the service name. For example
- Use the
systemctlcommand to enable the service in order to start after system boot. Note the suffix
.servicecan be omitted:
# systemctl enable httpd
In the above example we heave enabled the Apache
httpdservice to start during the system boot.
- If you later on decide to disable any service to start on boot use the
systemctlcommand once again as follows:
# systemctl disable httpd