cloud-images /etc/network/interfaces shoud source-directory interfaces.d

Bug #1262951 reported by Scott Moser
14
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-images
Fix Released
Medium
Unassigned

Bug Description

A cloud image /etc/network/interfaces currently looks like this:
| # This file describes the network interfaces available on your system
| # and how to activate them. For more information, see interfaces(5).
|
| # The loopback network interface
| auto lo
| iface lo inet loopback
|
| # The primary network interface
| auto eth0
| iface eth0 inet dhcp

A better version might be:
| # interfaces(5) file used by ifup(8) and ifdown(8)
| # Include files from /etc/network/interfaces.d:
| source-directory /etc/network/interfaces.d
|
| # The loopback network interface
| auto lo
|
| iface lo inet loopback
| auto eth0

We could possibly put 'eth0' inside /etc/network/interfaces.d
that might make it easier to remove/replace.

Scott Moser (smoser)
Changed in ubuntu:
milestone: none → ubuntu-14.01
Revision history for this message
Scott Moser (smoser) wrote :

So, some thoughts on this that I'd like to get some feedback on (slangasek or stgraber).

a.) Should we put 'eth0' configuration into /etc/network/interfaces.d?
  my feeling is that we should. This is possible to cause some breakage, but its fine with me to have to fix things. I'd just rather do it earlier than later in case there is fallout.
b.) what should we name that file? Would convention be 'eth0' ?

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

So the blurb that ifupdown puts in /etc/network/interfaces when it doesn't exist is:
"""
# interfaces(5) file used by ifup(8) and ifdown(8)
# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d"
"""

The loopback interface entry is no longer required as it's assumed to always be present by ifupdown.

There isn't any naming convention for files under /etc/network/interfaces.d/. So long as they match "^[a-zA-Z0-9_-]+$", "eth0" would seem reasonable to me.

Should you have to do any kind of migration, I'd suggest doing:
 - Move /etc/network/interfaces to /etc/network/interfaces.d/original
 - Rewrite /etc/network/interfaces with the content I posted above
 - Add any new /etc/network/interfaces.d/ entry that you may want

Revision history for this message
Ben Howard (darkmuggle-deactivatedaccount) wrote :

Moved eth0 configuration to /etc/network/interfaces.d and now sourced via /etc/network/interfaces file.

Marking fix commited pending builds through the Cloud Image build system.

Changed in ubuntu:
status: Triaged → Fix Committed
Changed in ubuntu:
status: Fix Committed → Fix Released
Revision history for this message
Martin Pitt (pitti) wrote :

This is incompatible with what Debian's ifupdown does: "source-directory /etc/network/interfaces.d/". This includes everything without a suffix, while this change includes every *.cfg file. This makes it rather hard to write snippets which work on both (which is e. g. necessary for autopkgtests).

Mathew Hodson (mhodson)
affects: ubuntu → cloud-images
Changed in cloud-images:
milestone: ubuntu-14.01 → none
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.