Check Service Is Running Or Not On Redhat/CentOs 7

0
20
views

Sometimes we need to check that service is running on server or not It helps us to troubleshoot easily. It’s a good practice to check service first before jumping on other things. We’re going to tell you different ways of checking service on Linux machine.

Here I’m going to check httpd service which is belong to Apache. You can check any service status by command  systemctl status servicename

status httpd

lsof meaning ‘LiSt Open Files’ is used to find out which files are open by which process.

You can use either port number or service name

Netstat –ntlp  command will show you all running service along with their port number and belong to which program name.

netstat status

systemctl list-units –type service command will show you all running service this can help you to find the failed service.

type

systemctl list-units –type mount

list-units

systemctl | grep httpd

grep htpd

systemctl list-unit-files list all service

failed service

You’re done

LEAVE A REPLY

Please enter your comment!
Please enter your name here