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 6.10 : /sbin/service serviceNAME status
/sbin/service serviceNAME status
for Centos 7.6 and ubuntu 18.04: systemctl status NAME.service
systemctl status NAME.service
works for all of them: service --status-all
service --status-all