《LINUX教程:Debian、Ubuntu系統中開機啟動設置》要點:
本文介紹了LINUX教程:Debian、Ubuntu系統中開機啟動設置,希望對您有用。如果有疑問,可以聯系我們。
Unix系統使用比擬廣泛的便是Linux系統,而基于Linux內核下也有很多衍生的其他的系統,其中就有Debian、Ubuntu這類的系統,在Linux系統下平時使用習慣的開機啟動/etc/rc.local或/etc/rc.d/rc.local就沒有了,那在Debian、Ubuntu下需要開啟啟動時就需要使用update-rc.d用來定義開機啟動的命令 ,舉一個簡單的例子在Debian、Ubuntu開機啟動iptables:
在Debian、Ubuntu中iptables并沒有被做成類似Linux下的服務,所以必要啟動時就用到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
這樣就在開機啟動時就會把自行界說寫好的iptables文件導入啟用,而在update-rc.d界說一些系統中的服務開機自啟也很簡單,如開啟自啟ssh服務:
root@localhost:/usr/local/scripts# update-rc.d ssh enable
這樣就啟用了開機自啟ssh服務,類似于Linux系統下的chkconfig、systemctl,當然更多的使用辦法可以參看man幫助手冊.
更多Ubuntu相關信息見Ubuntu 專題頁面 /topicnews.aspx?tid=2
本文永遠更新鏈接地址:
歡迎參與《LINUX教程:Debian、Ubuntu系統中開機啟動設置》討論,分享您的想法,維易PHP學院為您提供專業教程。
轉載請注明本頁網址:
http://www.snjht.com/jiaocheng/8839.html