探索,發現,愛好、學習,記錄,分享。
學海無涯,天涯若比鄰,三人行,必有我師。

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当前状态

版權聲明:本文采用知識共享 署名4.0國際許可協議 [BY-NC-SA] 進行授權
轉載事宜:如需轉載需徵得應允,轉載必須注明來源於本站的信息。
文章名称:《CentOS 7启动、重启、chkconfig等命令已经合并为systemctl》
文章链接:https://www.thefreesky.com/blog/23519.html
本站資源僅供個人學習交流,請於下載後24小時內刪除,不允許用於商業用途,否則法律問題自行承擔。

評論 抢沙发