在Ubuntu操作系统下,如果开机启动的时候网络没有连接,则会出现Waiting for network configuration....时间长达60s,难以接受
有两个解决办法
1、
修改/etc/network/interfaces文件
只保留以下:
auto lo
iface lo inet loopback
说明:设置静态IP不在此文范围
这样做的后果是网络设备并没有启用,用ifconfig查看是没有eth0信息的。
2、修改延时
编辑/etc/init/failsafe.conf文件
将第一个sleep从20秒改成5秒
# The point here is to wait for 2 minutes before forcibly booting
# the system. Anything that is in an "or" condition with 'started
# failsafe' in rc-sysinit deserves consideration for mentioning in
# these messages. currently only static-network-up counts for that.
sleep 5
把下面的语句都注释掉
#$PLYMOUTH message --text="Waiting for network configuration..." || :
#sleep 40
#$PLYMOUTH message --text="Waiting up to 60 more seconds for network con
figuration..." || :
#sleep 59
最大的延时就是上面的59秒。
上面第一点应该可以添加dhcp或static的配置,延时应该是第二点造成的,但我在设备上没有全面测试过。有一台服务器是使用dhcp的,但它一直连接网络,所以也不有这个问题。有一次换另外一个板子,发现进行上面的修改后,系统启动时还是会有Waiting for network configuration,而且卡死了,非重启不是恢复。暂时不知道是什么原因。特此说明一下。
参考:
http://ubuntuforums.org/showthread.php?t=1844755&page=45&p=11835741#post11835741
http://tech.pedersen-live.com/2012/05/disable-waiting-for-network-configuration-messages-on-ubuntu-boot/