《LINUX教程:Debian、Ubuntu系統(tǒng)中開機(jī)啟動(dòng)設(shè)置》要點(diǎn):
本文介紹了LINUX教程:Debian、Ubuntu系統(tǒng)中開機(jī)啟動(dòng)設(shè)置,希望對(duì)您有用。如果有疑問(wèn),可以聯(lián)系我們。
Unix系統(tǒng)使用比擬廣泛的便是Linux系統(tǒng),而基于Linux內(nèi)核下也有很多衍生的其他的系統(tǒng),其中就有Debian、Ubuntu這類的系統(tǒng),在Linux系統(tǒng)下平時(shí)使用習(xí)慣的開機(jī)啟動(dòng)/etc/rc.local或/etc/rc.d/rc.local就沒(méi)有了,那在Debian、Ubuntu下需要開啟啟動(dòng)時(shí)就需要使用update-rc.d用來(lái)定義開機(jī)啟動(dòng)的命令 ,舉一個(gè)簡(jiǎn)單的例子在Debian、Ubuntu開機(jī)啟動(dòng)iptables:
在Debian、Ubuntu中iptables并沒(méi)有被做成類似Linux下的服務(wù),所以必要啟動(dòng)時(shí)就用到update-rc.d,通過(guò)man手冊(cè)得知update-rc.d必要在/etc/init.d目錄下有啟動(dòng)文件,所以在Debian、Ubuntu下開啟iptables就可以通過(guò)以下方式:
root@localhost:/usr/local/scripts# vim iptables.sh
#!/bin/bash
/sbin/iptables-restore < /usr/local/scripts/iptables
root@localhost:/usr/local/scripts# ln -sv /usr/local/scripts/iptables.sh /etc/init.d/iptables
root@localhost:/usr/local/scripts# update-rc.d iptables defaults
這樣就在開機(jī)啟動(dòng)時(shí)就會(huì)把自行界說(shuō)寫好的iptables文件導(dǎo)入啟用,而在update-rc.d界說(shuō)一些系統(tǒng)中的服務(wù)開機(jī)自啟也很簡(jiǎn)單,如開啟自啟ssh服務(wù):
root@localhost:/usr/local/scripts# update-rc.d ssh enable
這樣就啟用了開機(jī)自啟ssh服務(wù),類似于Linux系統(tǒng)下的chkconfig、systemctl,當(dāng)然更多的使用辦法可以參看man幫助手冊(cè).
更多Ubuntu相關(guān)信息見Ubuntu 專題頁(yè)面 /topicnews.aspx?tid=2
本文永遠(yuǎn)更新鏈接地址:
歡迎參與《LINUX教程:Debian、Ubuntu系統(tǒng)中開機(jī)啟動(dòng)設(shè)置》討論,分享您的想法,維易PHP學(xué)院為您提供專業(yè)教程。
轉(zhuǎn)載請(qǐng)注明本頁(yè)網(wǎng)址:
http://www.fzlkiss.com/jiaocheng/8839.html