Main Menu

Search

Showing posts with label Service. Show all posts
Showing posts with label Service. Show all posts

LINUX: How To Find Failed Services and Modules on Linux Machine? (systemctl command)

Below "systemctl" command can be used to find the failed services and modules on Linux machine.
systemctl | grep -i fail
Below is sample output of above command which shows one failed service.


● systemd-binfmt.service                                        loaded failed failed    Set Up Additional Binary Formats


Products to which Article Applies




LINUX: How To Check Which Services Are Enabled on Linux Machine? ("systemctl" command)

Below "systemctl" Command can be used to check all the services enabled on Linux machine.
systemctl list-unit-files 

Below is example snippet of above command.

UNIT FILE                                     STATE

tmp.mount                                     disabled
var-lib-nfs-rpc_pipefs.mount                  static
brandbot.path                                 enabled
systemd-ask-password-console.path             static
systemd-ask-password-wall.path                static
session-2.scope                               static
acpid.service                                 enabled


Products to which Article Applies


All Linux Operating Systems

Additional References


https://www.digitalocean.com/community/tutorials/how-to-use-systemctl-to-manage-systemd-services-and-units

LINUX: How To Enable Particular Service Using "systemctl" Command To Auto Start During Reboot?

Below "systemctl" Command can be used to enable particular Service.
systemctl enable <service name>

For example if you want to enable Docket service to start when Linux Machine reboots, your "systemctl" command will look as follows:



systemctl enable docker

Once the service is enable run below command to verify that the service is enabled.

systemctl list-unit-files | grep -i <service>

For e.g. if you enabled Docker service, you can run below command to verify whether the Docker service is enabled.
systemctl list-unit-files | grep -i docker.

Below is example output of above command.
# systemctl list-unit-files | grep -i docker
docker.service          enabled


Products to which Article Applies


All Linux Operating Systems

Additional References

https://www.digitalocean.com/community/tutorials/how-to-use-systemctl-to-manage-systemd-services-and-units

LINUX: How To Check the Status of All the Services In Linux?

Below command can be used to check the status of all the services on Linux
service --status-all

Below is example snippet (partial output) of above command for reference.
# service --status-all
Checking for ibacm service [  OK  ]
Host Administrated vNics: none.
netconsole module not loaded
Configured devices:
lo bond0 bond1 bond2 bond3 bond4 eth646_1.318 eth1286_2.318 eth0 eth0.800b eth0.8004 eth0.8006 eth1 eth1.800b eth1.8004 eth1.8006
Currently active devices:


Products to which Article Applies


All Linux environments

Additional References

https://www.cyberciti.biz/faq/check-running-services-in-rhel-redhat-fedora-centoslinux/



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