How to check if a particular service is running on Ubuntu

前端 未结 13 1907
猫巷女王i
猫巷女王i 2021-01-29 17:48

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

13条回答
  •  南方客
    南方客 (楼主)
    2021-01-29 18:01

    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
    

提交回复
热议问题