這篇文章給大家分享的是有關(guān)如何解決centos7開機(jī)/etc/rc.local不執(zhí)行的問(wèn)題的內(nèi)容。小編覺(jué)得挺實(shí)用的,因此分享給大家做個(gè)參考,一起跟隨小編過(guò)來(lái)看看吧。
最近發(fā)現(xiàn)centos7 的/etc/rc.local不會(huì)開機(jī)執(zhí)行,于是認(rèn)真看了下/etc/rc.local文件內(nèi)容的就發(fā)現(xiàn)了問(wèn)題的原因了
#!/bin/bash # THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES # # It is highly advisable to create own systemd services or udev rules # to run scripts during boot instead of using this file. # # In constrast to previous versions due to parallel execution during boot # this script will NOT be run after all other services. # # Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure # that this script will be executed during boot.
翻譯:
#這個(gè)文件是為了兼容性的問(wèn)題而添加的。 # #強(qiáng)烈建議創(chuàng)建自己的systemd服務(wù)或udev規(guī)則來(lái)在開機(jī)時(shí)運(yùn)行腳本而不是使用這個(gè)文件。 # #與以前的版本引導(dǎo)時(shí)的并行執(zhí)行相比較,這個(gè)腳本將不會(huì)在其他所有的服務(wù)后執(zhí)行。 # #請(qǐng)記住,你必須執(zhí)行“chmod +x /etc/rc.d/rc.local”來(lái)確保確保這個(gè)腳本在引導(dǎo)時(shí)執(zhí)行。
于是我有確認(rèn)了下/etc/rc.local的權(quán)限
[root@localhost ~]# ll /etc/rc.local lrwxrwxrwx. 1 root root 13 8月 12 06:09 /etc/rc.local -> rc.d/rc.local [root@localhost ~]# ll /etc/rc.d/rc.local -rw-r--r--. 1 root root 477 6月 10 13:35 /etc/rc.d/rc.local
/etc/rc.d/rc.local沒(méi)有執(zhí)行權(quán)限,于是按說(shuō)明的內(nèi)容執(zhí)行
chmod +x /etc/rc.d/rc.local
重啟后發(fā)現(xiàn)/etc/rc.local能夠執(zhí)行了。
看樣子是版本的變遷,/etc/rc.local /etc/rc.d/rc.local正在棄用的路上。
感謝各位的閱讀!關(guān)于“如何解決centos7開機(jī)/etc/rc.local不執(zhí)行的問(wèn)題”這篇文章就分享到這里了,希望以上內(nèi)容可以對(duì)大家有一定的幫助,讓大家可以學(xué)到更多知識(shí),如果覺(jué)得文章不錯(cuò),可以把它分享出去讓更多的人看到吧!
分享文章:如何解決centos7開機(jī)/etc/rc.local不執(zhí)行的問(wèn)題-創(chuàng)新互聯(lián)
當(dāng)前URL:http://jinyejixie.com/article16/dcgodg.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供外貿(mào)建站、定制網(wǎng)站、域名注冊(cè)、網(wǎng)頁(yè)設(shè)計(jì)公司、靜態(tài)網(wǎng)站、App設(shè)計(jì)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)