I would like to check the status of a service on my centos 7 or rhel 7 system. How do I check if a service is running or not under centos 7 or rhel 7 operating system? How to get out status of all services on the current cnetos 7 system? this article will guide you how to check a service status on centos 7 system.
You need to use systemctl command with “status” option to get a service status.
Check service status on centos 7
Type the following command:
systemctl status <service name>.service
or
systemctl status <service name>
For example, if you want to check status of httpd service, just issue the following command:
systemctl status httpd.service
or
systemctl status httpd
outputs:
[root@devops Desktop]# systemctl status httpd.service httpd.service - The Apache HTTP Server Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled) Active: active (running) since Tue 2015-01-06 10:14:18 CET; 2s ago Main PID: 12948 (httpd) Status: "Processing requests..." CGroup: /system.slice/httpd.service ├─12948 /usr/sbin/httpd -DFOREGROUND ├─12949 /usr/sbin/httpd -DFOREGROUND ├─12950 /usr/sbin/httpd -DFOREGROUND ├─12951 /usr/sbin/httpd -DFOREGROUND ├─12952 /usr/sbin/httpd -DFOREGROUND └─12953 /usr/sbin/httpd -DFOREGROUND Jan 06 10:14:17 devops systemd[1]: Starting The Apache HTTP Server... Jan 06 10:14:18 devops systemd[1]: Started The Apache HTTP Server. Hint: Some lines were ellipsized, use -l to show in full.
See Also: