Centos 7.0設置/etc/rc.local無效問題解決

安裝centos7以後按照以往習慣修改rc.local添加開機啓動命令,但重啓後發現無效,再次重啓發現依然如故

檢查系統rc.local服務運行情況

systemctl | grep "rc.local"
# rc-local.service                                                                          loaded active running   /etc/rc.d/rc.local Compatibility

發現運行正常

隨後查看rc.local文件

vim /etc/rc.local

發現這麼一句話

Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure

由於/etc/rc.local是/etc/rc.d/rc.local的軟連接,所以必須確保/etc/rc.local和/etc/rc.d/rc.local都有x權限(可執行)

執行命令

chmod +x /etc/rc.d/rc.local

重啓,一切正常,問題解決。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章