新裝完 CentOS 7 後,遇到了兩個新改變,一是以前啟動服務的方式已經無法使用,另一個是防火牆iptables不見了,似乎用了另外的方式來管理防火牆。
底下先說明啟動服務的方式異動。

舊的方法一:
/etc/init.d/servicename restart


舊的方法二:
serice servicename restart


新的方式要透過 systemctl
常用指令:
systemctl start|stop|restart|is-active|status|enable|disable servicename.service

start:啟動服務
stop:停止服務
restart:重啟服務
is-active:查看服務是否有效的
status:查看服務狀態
enable:將服務設定成系統啟動時自動啟動服務
disable:將服務設定成系統啟動時不啟動服務

另外以前的reboot, halt, poweroff似乎也變成
systemctl halt
systemctl reboot
systemctl poweroff

arrow
arrow
    全站熱搜

    mark528 發表在 痞客邦 留言(0) 人氣()