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
There is a simple way to verify if a service is running
systemctl status service_name
Try PostgreSQL:
systemctl status postgresql