執行ll /etc/rc.local命令,發現/etc/rc.local映射文件是/etc/rc.d/rc.local
再ll /etc/rc.d/rc.local發現這個文件沒有執行權限(少了x);
其實vi /etc/rc.local有這樣一段話
# Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure
# that this script will be executed during boot.
所以執行chome +x /etc/rc.d/rc.local命令后,啟動可以執行這個文件了。
但是還有一個問題,需要保證rc.local文件里面執行的腳本都是可執行的,否則依然無效。
另外如果在rc.local添加多條重復的啟動命令腳本,也是無效的。