[Bug 838968] Re: static-network-up event does not wait for interfaces to have an address
Scott Moser
smoser at canonical.com
Fri Sep 2 19:57:45 UTC 2011
I just uploaded, but wanted to put some evidence of this being fixed here.
On the system that was taking 45 seconds for dhcp (where we saw this bug) we have:
$ ls -altr --full-time /run/network
total 4
-rw-r--r-- 1 root root 0 2011-09-02 15:46:56.877861983 -0400 ifup.lo
drwxr-xr-x 2 root root 40 2011-09-02 15:47:34.157861476 -0400 static-network-up-emitted
-rw-r--r-- 1 root root 0 2011-09-02 15:47:34.157861476 -0400 ifup.eth0
-rw-r--r-- 1 root root 16 2011-09-02 15:47:34.157861476 -0400 ifstate
Then, in /var/log/cloud-init.log:
2011-09-02 15:46:57,745 - cloud-init[INFO]: cloud-init start-local running: Fri, 02 Sep 2011 19:46:57 +0000. up 7.91 seconds
2011-09-02 15:46:57,755 - __init__.py[DEBUG]: searching for data source in ['DataSourceNoCloud']
2011-09-02 15:46:57,764 - __init__.py[DEBUG]: Did not find data source. searched classes: ['DataSourceNoCloud']
2011-09-02 15:47:34,300 - cloud-init[INFO]: cloud-init start running: Fri, 02 Sep 2011 19:47:34 +0000. up 44.51 seconds
Note, 'ifup.lo' was created at 46:56, and that cloud-init local ran at (utc) 46:57.
ifup.eth0 and static-network-up-emitted were created at 47:34 (38 seconds later) and cloud-init started at 47:34 (immediately following).
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to ifupdown in Ubuntu.
https://bugs.launchpad.net/bugs/838968
Title:
static-network-up event does not wait for interfaces to have an
address
Status in “cloud-init” package in Ubuntu:
Fix Released
Status in “ifupdown” package in Ubuntu:
Fix Released
Bug description:
cloud-init's /etc/init/cloud-init-nonet.conf is configured to block
running of cloud-init.conf until "static-network-up" is emitted.
The point of that event was to wait until interfaces were all
configured, and thus the network available.
In practice, what I'm seeing is that for dhcp interfaces configured like:
# The primary network interface
auto eth0
iface eth0 inet dhcp
ifupdown runs /etc/network/if-up.d/upstart immediately upon forking
off dhclient.
$ ls -ld --full-time /var/run/network/static-network-up-emitted
drwxr-xr-x 2 root root 40 2011-09-01 12:21:26.778833999 -0400 /var/run/network/static-network-up-emitted
Then, in /var/log/syslog, the first non-kernel messages for this boot start at 12:21:28. relevant dhcp messages are:
Sep 1 12:21:29 mabolo dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 7
Sep 1 12:21:30 mabolo kernel: [ 10.885045] bnx2 0000:02:00.0: eth0: NIC Copper Link is Up, 1000 Mbps full duplex
Sep 1 12:21:30 mabolo kernel: [ 10.886232] ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
Sep 1 12:21:36 mabolo dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 13
...
Sep 1 12:22:13 mabolo dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 14
Sep 1 12:22:13 mabolo dhclient: DHCPOFFER of 10.55.55.5 from 10.55.55.7
Sep 1 12:22:13 mabolo dhclient: DHCPREQUEST of 10.55.55.5 on eth0 to 255.255.255.255 port 67
Sep 1 12:22:14 mabolo dhclient: DHCPACK of 10.55.55.5 from 10.55.55.7
Sep 1 12:22:14 mabolo dhclient: can't create /var/lib/dhcp3/dhclient.eth0.leases: No such file or directory
Sep 1 12:22:14 mabolo dhclient: bound to 10.55.55.5 -- renewal in 1399 seconds.
So it would surely appear that the event is happening immediately.
However, to test this theory, I put the following into /etc/network/if-up.d/myfootest, and set up 'eth1' in /etc/network/interfaces.. (I knew that there would be no response on eth1's interface.)
#!/bin/sh
(
echo "===== $(date -R) ====="
echo "IFACE=$IFACE LOGICAL=$LOGICAL ADDRFAM=$ADDRFAM METHOD=$METHOD MODE=$MODE PHASE=$PHASE"
ifconfig $IFACE
) | tee -a /var/log/myfoo.log
exit 0
Then, i ran 'sudo ifup eth1' and that took almost exactly 1 minute before writing the log and to the screen. One difference between the two is that eth1 is not attached to a device per ethtool.
ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: ifupdown 0.7~alpha5.1ubuntu3
ProcVersionSignature: User Name 3.0.0-9.15-virtual 3.0.3
Uname: Linux 3.0.0-9-virtual i686
Architecture: i386
Date: Thu Sep 1 17:02:21 2011
Ec2AMI: ami-00000070
Ec2AMIManifest: FIXME
Ec2AvailabilityZone: nova
Ec2InstanceType: m1.small
Ec2Kernel: unavailable
Ec2Ramdisk: unavailable
ProcEnviron:
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: ifupdown
UpgradeStatus: No upgrade log present (probably fresh install)
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cloud-init/+bug/838968/+subscriptions
More information about the foundations-bugs
mailing list