如何检查特定服务是否在Ubuntu上运行 [英] How to check if a particular service is running on Ubuntu

查看:212
本文介绍了如何检查特定服务是否在Ubuntu上运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道该服务的名称,但想通过检查其状态来停止该服务.

I do not know the service's name, but would like to stop the service by checking its status.

例如,如果我要检查 PostgreSQL 服务是否正在运行,但是我不知道该服务的名称,那么如何查看其状态?

For example, if I want to check if the PostgreSQL service is running or not, but I don't know the service's name, then how could I check its status?

我知道用于检查服务名称是否已知的状态的命令.

I know the command to check the status if the service name is known.

推荐答案

我没有Ubuntu盒子,但是在 Red Hat上Linux ,您可以通过运行以下命令来查看所有正在运行的服务:

I don't have an Ubuntu box, but on Red Hat Linux you can see all running services by running the following command:

service --status-all

在列表中,+表示服务正在运行,-表示服务未运行,?表示无法确定服务状态.

On the list the + indicates the service is running, - indicates service is not running, ? indicates the service state cannot be determined.

这篇关于如何检查特定服务是否在Ubuntu上运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆