CentOS 7 啟動、重啟、chkconfig等命令已經合並為systemctl


CentOS 7系統服務啟動、重啟、設置服務啟動項命令以合並為,systemctl . 現在用service 或/etc/init.d/命令,重啟,重新啟動,停止等沒效果,因為命令合並為systemctl. 新命令具體內容如下:

以啟動httpd和設置Apache httpd為服務啟動為例子:
centos7之前的命令是這樣:

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 停止服務

centos7吧這些命令全部合並了,使用也更加方便,當然也是習慣問題,如果習慣了之前命令,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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM