CentOS 7启动、重启、chkconfig等命令已经合并为systemctl

CentOS 7系统服务启动、重启、设置服务启动项命令以合并为,systemctl . 现在用service 或/etc/init.d/命令,重启,重新启动,停止等没效果,因为命令合并为systemctl. 新命令具体内容如下:

以启动httpd和设置Apache httpd为服务启动为例子:

CentOS 7之前的命令是这样:

service httpd start 启动Apache httpd

service httpd restart 重新启动

service httpd stop 停止服务

chkconfig –levels 235 httpd on 开机启动httpd

或是:

/etc/init.d/ httpd start 启动

/etc/init.d/ httpd restart 重新启动

/etc/init.d/ httpd stop 停止服务

CentOS 7吧这些命令全部合并了,使用也更加方便,当然也是习惯问题,如果习惯了之前命令,centos新命令还得适应适应,其实很简单,只要这样记忆,使用就比较方便了.

systemctl 动作 服务名.service

一些centos7 systemctl命令简单实用实例:

systemctl start httpd.service /启动Apache httpd

systemctl restart httpd.service /重新启动

systemctl stop httpd.service /停止服务

systemctl enable httpd.service /开机启动httpd

systemctl disable httpd.service /禁止开机启动httpd

systemctl status httpd.service /httpd当前状态

給TA打賞
共{{data.count}}人
人已打賞
服務器運維

解决宝塔面板强制重启系统导致mysql无法启动

2016-11-8 21:21:39

服務器運維

修复损坏的MySQL数据表

2016-11-9 21:43:20

0 Reply AAuthor MManager
    暫無討論,說說你的看法吧
搜索