ifup fails on boot if initramfs already configured the device

Bug #1080975 reported by Stephen Warren
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
ifupdown (Ubuntu)
Triaged
Low
Unassigned

Bug Description

I have a server with a static IP, so I put the following into /etc/network/interfaces to configure it:

auto eth0
iface eth0 inet static
    address 192.168.63.152
    network 192.168.63.0
    netmask 255.255.255.0
    broadcast 192.168.63.255
    gateway 192.168.63.1

However, if the initramfs brought up that interface, then ifup fails to bring it up (again). The error message was something like "NETLINK: address already exists" if I ran "ifup eth0" after the system had booted at least.

For the record, I have the following in /etc/initramfs-tools/initramfs.conf:

DEVICE=eth0
IP=192.168.63.152::192.168.63.1:255.255.255.0:avon.wwwdotorg.org:eth0:off

... although I did try commenting out those two lines and rebuilding the initramfs and it made no difference; I assume because eth0 was still brought up, just with DHCP rather than a static IP.

This is a problem if I have a cryptoroot, and I've configured the initramfs to bring up the network along with dropbear, so I can ssh in and unlock the cryptoroot. In this case, after the root is unlocked, mounted, and the "real" boot starts, ifup fails, and hence the static-network-up upstart event is never emitted, and hence /etc/init/failsafe.conf sleeps for 2 whole minutes before booting the system completely, with is extremely annoying.

A hacky workaround is to edit e.g. /usr/share/initramfs-tools/scripts/init-bottom/dropbear and add the following line right at the very end:

ifconfig eth0 0.0.0.0 down

Then, the system boots quickly.

Revision history for this message
Stéphane Graber (stgraber) wrote :

It's always a problem when mixing different tools doing pretty much the same job.
ifupdown always assumes it's the only tool messing with network interfaces and so will fail if any conflicting configuration is found.

Changed in ifupdown (Ubuntu):
importance: Undecided → Low
status: New → Triaged
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.