让ubuntu开机快一点:记开机出现Waiting for network configuration...

新制作出来的系统,可以正常在设备上跑,不过有个小问题,就是启动时,如果不接网线的话,会卡在一个地方,卡很久。信息如下:

1
2
Waiting for network configuration...
Waiting up to 60 more seconds for network configuration...

在网上查了些资料,做了些笔记。

1、 修改/etc/network/interfaces文件

只保留以下:

1
2
auto lo
iface lo inet loopback

说明:设置静态IP不在此文范围 这样做的后果是网络设备并没有启用,用ifconfig查看是没有eth0信息的。

2、修改延时

编辑/etc/init/failsafe.conf文件,将第一个sleep从20秒改成5秒

1
2
3
4
5
6
# 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

把下面的语句都注释掉

1
2
3
4
5
6
7
#$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,而且卡死了,非重启不是恢复。暂时不知道是什么原因。特此说明一下。

参考:
1、http://ubuntuforums.org/showthread.php?t=1844755&page=45&p=11835741#post11835741

2、http://tech.pedersen-live.com/2012/05/disable-waiting-for-network-configuration-messages-on-ubuntu-boot/

李迟,2014年11月10日,周一晚