簡單說明下 centos 6 與 centos 7 服務開機啟動、關閉設置的方法:
centos 6 :使用chkconfig命令即可。
我們以apache服務為例:
#chkconfig --add apache 添加nginx服務
#chkconfig apache on 開機自啟nginx服務
#chkconfig apache off 關閉開機自啟
#chkconfig --list | grep apache 查看
centos 7 :使用systemctl中的enable、disable 即可。
示例:
#systemctl enable apache.service 開機自啟apache服務
#systemctl disable apache.service 關閉開機自啟
#systemctl list-unit-files|grep iptables 查看iptables是否開機啟動的狀態