static-network-up event does not wait for interfaces to have an address
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init (Ubuntu) |
Fix Released
|
Medium
|
Unassigned | ||
ifupdown (Ubuntu) |
Fix Released
|
High
|
Scott Moser | ||
isc-dhcp (Ubuntu) |
Fix Released
|
Medium
|
Steve Langasek |
Bug Description
cloud-init's /etc/init/
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/
$ ls -ld --full-time /var/run/
drwxr-xr-x 2 root root 40 2011-09-01 12:21:26.778833999 -0400 /var/run/
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(
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/
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/
#!/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.
Related Bugs:
* bug 974284: invoking dhclient3 with -1 causes issue if no dhcp server available
ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: ifupdown 0.7~alpha5.1ubuntu3
ProcVersionSign
Uname: Linux 3.0.0-9-virtual i686
Architecture: i386
Date: Thu Sep 1 17:02:21 2011
Ec2AMI: ami-00000070
Ec2AMIManifest: FIXME
Ec2Availability
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)
Related branches
- Steve Langasek: Approve
- Ubuntu branches: Pending requested
-
Diff: 86 lines (+27/-14)3 files modifieddebian/changelog (+12/-0)
debian/ifupdown.upstart.if-up (+14/-13)
ifupdown.nw (+1/-1)
Changed in ifupdown (Ubuntu): | |
status: | New → Triaged |
importance: | Undecided → High |
milestone: | none → ubuntu-11.10-beta-2 |
assignee: | nobody → Scott Moser (smoser) |
description: | updated |
Just to be clear, static-network-up should not fire until interfaces at least have an ipv4 (or ipv6) address and it appears to be firing immediately upon their coming up.