Linux服务常用命令

CentOS6

服务管理

service 服务名 start
service 服务名 stop
service 服务名 restart
service 服务名 reload
service 服务名 status

查看服务

/ect/init.d/服务名

设置自启动

chkconfig --list|grep xxx
chkconfig --level 5 服务名 on

CentOS7

服务管理

systemctl start 服务名 
systemctl stop 服务名 
systemctl restart 服务名 
systemctl reload 服务名 
systemctl status 服务名 

查看服务方法

/usr/lib/systemd/system

查看服务命令

systemctl list -unit-files | grep 服务名
systemctl --type service | grep 服务名

设置自启动

systemctl enable 服务名
systemctl disable 服务名
发布了71 篇原创文章 · 获赞 12 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/weixin_42103026/article/details/104075645