Main Menu

Search

LINUX: How to Enable Service On Linux Nodes Using Systemctl Command? (How To Doc)



On Linux 7 & above versions "chkconfig --list" command cannot be used for enabling the services.
We will have to use systemctl command to check and enable services on Linux 7 and above versions.

Follow below steps to enable the desired service on Linux OS using systemctl command.


1. Check the status of the service using below command.
systemctl list-unit-files | grep -i <service name>


Below is sample output which shows the status of docker as disabled.
# systemctl list-unit-files | grep -i docker
docker.service                                disabled
docker.socket                                 disabled


2. Enable the desired service using below command.
systemctl enable docker


Below is sample snippet of enabling the docker service using systemctl command.
# systemctl enable docker
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.


3. Check the status of the service using below command.
systemctl list-unit-files | grep -i <service name>


You will see that the service is enabled. Below is the sample output which shows docker service as being enabled.
# systemctl list-unit-files | grep -i docker
docker.service                                enabled
docker.socket                                 disabled

Products to which Article Applies


All Host Operating Systems Using ILOM

Additional Reference



tarun boyella


No comments:

Post a Comment