How to Configure Network Services to Auto Start on Boot

It’s usually a good idea to configure essential network services to automatically start on boot. This saves you the hassle of starting them manually upon a reboot and also, the resulting havoc caused in case you forget to do so. Some of the crucial network services include SSH, NTP, and httpd.

You can confirm what is your system service manager by running the following command.

# ps --pid 1
Check Linux Service Manager
Check Linux Service Manager

Based on the output of the above command, you will use one of the following commands to configure whether each service should start automatically on boot or not:

On systemd-based
----------- Enable Service to Start at Boot -----------
# systemctl enable [service]
----------- Prevent Service from Starting at Boot -----------
# systemctl disable [service] # prevent [service] from starting at boot
On sysvinit-based
----------- Start Service at Boot in Runlevels A and B -----------
# chkconfig --level AB [service] on 
-----------  Don’t Start Service at boot in Runlevels C and D -----------
# chkconfig --level CD service off 

On a systemd system like CentOS 8, RHEL 8 and Fedora 30+, the systemctl command is used for managing services. For example, to have a view of the disabled services, run the command:

$ sudo systemctl list-unit-files --state=disabled
$ sudo chkconfig --list     [On sysvinit-based]

The output below prints out all the disabled services and as you can see, the httpd service is listed, implying that it is not configured to start on boot.

List Disabled Network Services
List Disabled Network Services

To enable a service to start on boot, use the syntax:

$ sudo systemctl enable service-name
$ sudo chkconfig service_name on     [On sysvinit-based] 

For example, to enable httpd service on boot execution.

$ sudo systemctl enable httpd
$ sudo chkconfig httpd on     [On sysvinit-based] 

To confirm that the httpd service has been enabled, list all the enabled services by executing the command:

$ sudo systemctl list-unit-files --state=enabled
$ sudo chkconfig --list | grep 3:on     [On sysvinit-based] 
List Enabled Network Services
List Enabled Network Services

From the output above, we can clearly see that the httpd service now appears in the list of enabled services.

To learn more about systemctl and chkconfig commands, read these following articles:

If you liked this article, then do subscribe to email alerts for Linux tutorials. If you have any questions or doubts? do ask for help in the comments section.

If You Appreciate What We Do Here On TecMint, You Should Consider:

TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

Support Us

We are thankful for your never ending support.

Got something to say? Join the discussion.

Have a question or suggestion? Please leave a comment to start the discussion. Please keep in mind that all comments are moderated and your email address will NOT be published.