15
2019
03
10:25:55

centos7 系统管理systemd学习记录



推荐点击下面图片,通过本站淘宝优惠价购买:

image.png

在centos7之前,系统服务是service,chkconfig等命令来管理的。到了centos7,统一使用systemctl来管理系统服务

其实就是把chkconfig和service结合在一起了,chkconfig主要用来控制开机自启动,service则是用来管理服务的开启关闭的

service mysqld start    systemctl start mysqld  启动服务

service mysqld stop    systemctl stop mysqld  关闭服务 

service mysqld reload   systemctl reload mysqld  重新加载配置文件

service mysqld restart    systemctl restart mysqld  重启服务

service mysqld status    systemctl status mysqld  查看服务状态

其实就是把service换成systemctl,并且把命令提前了,很好理解

chkconfig mysqld on  systemctl enable mysqld  开机自动启动

chkconfig mysqld off  systemctl disable mysqld  开机不自动启动

chkconfig mysqld    systemctl is-enabled mysqld  查看特定服务是否开机启动

chkconfig --list     systemctl list-unit-files --type=service  查看各个级别下服务的启动和禁用情况

其实到了centos7之后service和chkconfig命令都还可以使用,但是推荐使用systemctl,使用之前的命令的时候系统会提示你改用systemctl对应的命令


本文链接:http://www.hqyman.cn/post/351.html 非本站原创文章欢迎转载,原创文章需保留本站地址!

分享到:





休息一下,本站随机推荐观看栏目:


« 上一篇 下一篇 »

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

您的IP地址是: