linux怎样查看 某项服务 当前启动状态

linux怎样查看 某项服务 当前启动状态,第1张

可以在Linux下输入命令:

1、$service sshd status

2、#service servicename status是当前状态

3、#chkconfig --list servicename是查看启动状态,也就是是否开机自动启动

注:

1、如果service和chkconfig 找不到,可以试试/sbin/service和/sbin/chkconfig

2、如果用ubuntu好像是要用/etc/init.d/servicename status查看当前状态

(servicename就是你要查的服务名)

扩展资料:

查看某项服务当前启动状态的其他方式

一、利用进程来查看

命令里 ps -aux | grep xxx 是查看某个进程或者服务是否存在。

二、利用services命令

1、查看单个服务的运行状态: service 服务名 status

如:[root@localhost ~]# service sshd status

openssh-daemon (pid 3701) 正在运行?

2、查看所有服务的运行状态: service _status -all

检测linux系统下ftp服务器是否开启的方法如下:

1、第一步,打开一台Linux的电脑,进入到输入shell指令的命令行状态下,如下图所示。

2、第二步,使用键盘在命令行中输入:”service vsftp status“这个指令,指令的意思是查看ftp服务器的状态,如下图所示。

3、第三步,输入完成之后,点击”回车键“运行该指令,就会显示ftp服务器的开关状态,比如下图就是“inactive”状态,表示ftp服务器处于关闭状态,如下图所示。

SysV服务管理系统 例如 RedHat6等发行版

service --status-all 查看所有服务

service servicename status 查看指定服务状态

service servicename start|stop|restart 启动|停止|重启 指定服务

systemd服务管理系统 如CentOS 7等

systemctl is-enabled servicename.service #查询服务是否开机启动

systemctl enable *.service #开机运行服务

systemctl disable *.service #取消开机运行

systemctl start *.service #启动服务

systemctl stop *.service #停止服务

systemctl restart *.service #重启服务

systemctl reload *.service #重新加载服务配置文件

systemctl status *.service #查询服务运行状态

systemctl --failed #显示启动失败的服务


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/yw/8490370.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-17
下一篇 2023-04-17

发表评论

登录后才能评论

评论列表(0条)

保存