I do not know the service\'s name, but would like to stop the service by checking its status.
For example, if I want to check if the PostgreSQL service is running or no
For centos, below command worked for me (:
locate postgres | grep service
Output:
/usr/lib/firewalld/services/postgresql.xml
/usr/lib/systemd/system/postgresql-9.3.service
sudo systemctl status postgresql-9.3.service