新聞中心
Unix系統(tǒng)使用比較廣泛的便是Linux系統(tǒng),而基于Linux內(nèi)核下也有很多衍生的其他的系統(tǒng),其中就有Debian、Ubuntu這類的系統(tǒng),在Linux系統(tǒng)下平時使用習(xí)慣的開機(jī)啟動/etc/rc.local或/etc/rc.d/rc.local就沒有了,那在Debian、Ubuntu下需要開啟啟動時就需要使用update-rc.d用來定義開機(jī)啟動的命令 ,舉一個簡單的例子在Debian、Ubuntu開機(jī)啟動iptables:

創(chuàng)新互聯(lián)是一家專注于做網(wǎng)站、網(wǎng)站制作與策劃設(shè)計,澗西網(wǎng)站建設(shè)哪家好?創(chuàng)新互聯(lián)做網(wǎng)站,專注于網(wǎng)站建設(shè)10余年,網(wǎng)設(shè)計領(lǐng)域的專業(yè)建站公司;建站業(yè)務(wù)涵蓋:澗西等地區(qū)。澗西做網(wǎng)站價格咨詢:18982081108
在Debian、Ubuntu中iptables并沒有被做成類似Linux下的服務(wù),所以需要啟動時就用到update-rc.d,通過man手冊得知update-rc.d需要在/etc/init.d目錄下有啟動文件,所以在Debian、Ubuntu下開啟iptables就可以通過以下方式:
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ī)啟動時就會把自行定義寫好的iptables文件導(dǎo)入啟用,而在update-rc.d定義一些系統(tǒng)中的服務(wù)開機(jī)自啟也很簡單,如開啟自啟ssh服務(wù):
root@localhost:/usr/local/scripts# update-rc.d ssh enable
這樣就啟用了開機(jī)自啟ssh服務(wù),類似于Linux系統(tǒng)下的chkconfig、systemctl,當(dāng)然更多的使用方法可以參看man幫助手冊。
網(wǎng)頁題目:Debian、Ubuntu系統(tǒng)中開機(jī)啟動設(shè)置
文章網(wǎng)址:http://www.dlmjj.cn/article/pdosdh.html


咨詢
建站咨詢
