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