
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 #显示启动失败的服务
linux系统使用 chkconfig --list 查看当前开启的服务
1. chkconfig --list 查询出所有当前运行的服务
2. chkconfig --list atd 查询atd服务的当前状态
3. chkconfig --list |grep on 查看当前处于运行状态的服务,用此语句过滤即可
扩展资料:
chkconfig在没有参数运行时,显示用法。如果加上服务名,那么就检查这个服务是否在当前运行级启动。如果是,返回true,否则返回false。如果在服务名后面指定了on,off或者reset,那么chkconfi 会改变指定服务的启动信息。
on和off分别指服务被启动和停止,reset指重置服务的启动信息,无论有问题的初始化脚本指定了什么。on和off开关,系统默认只对运行级3,4,5有效,但是reset可以对所有运行级有效。
参考资料来源:linux官网
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)