14.04 /etc/network/interfaces is always overwritten by Preseed

Bug #1361902 reported by YamakasY
50
This bug affects 10 people
Affects Status Importance Assigned to Milestone
netcfg (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

I'm having trouble with my /etc/network/interfaces file that is
overwritten by every Preseed install.

I have found out that when I let the late_command crash and I manually
enter some identifier in:

/etc/network/interfaces

and

/target/etc/network/interfaces

the one in /etc/network/interfaces stays there, so no overwriting from
the target version in that case.

the fix to place the following in the late_command doesn't fix it either:

cp /target/etc/network/interfaces /etc/network/interfaces

Any idea on how to fix this ?

Tags: scale
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package netcfg - 1.119ubuntu1

---------------
netcfg (1.119ubuntu1) utopic; urgency=medium

  * Resynchronise with Debian. Remaining changes:
    - Set default hostname to 'ubuntu'.
    - Set priority for get_domain to high for static configurations.
    - Set priority for get_domain to medium for non-static configurations.
    - Use 'auto <interface>' for all interfaces, dropping allow-hotplug
      which doesn't work with current udev.
    - Set DHCP and DHCPv6 timeout to 30s.
    - Use isc-dhcp-client-udeb on all architectures.
    - Flush all addresses and routes before configuring interfaces
      (LP: #848072)
    - Don't copy /etc/resolv.conf to target if resolvconf is installed. (We
      already write resolvconf configuration to /etc/network/interfaces.)
    - Add a post-base-install hook to detect resolvconf and copy
      /run/resolvconf/resolv.conf to outside the target so that when /run is
      bind-mounted DNS resolving continues to work. (LP: #926447)
    - Apply patch from Alec Warner making netcfg respect
      netcfg/dhcpv6_timeout and running dhclient in one-shot mode (-1).
      (LP: #917905)
    - Fix FTBFS by checking the return value of fgets and fscanf.
    - Fix nm-conf to generate a valid NetworkManager static configuration
      file.

netcfg (1.119) unstable; urgency=medium

  [ Colin Watson ]
  * Don't copy /etc/network/interfaces to /target if
    netcfg/target_network_config=ifupdown; it's already been copied by the
    base-installer hook earlier, and copying it again makes it hard to
    modify /target/etc/network/interfaces in a preseed file (closes:
    #709017, LP: #1361902).
  * Fix BOOTIF detection to handle the newline at the end of a line read
    from /proc/cmdline (LP: #1350302).

  [ Updated translations ]
  * Estonian (et.po) by Mattias Põldaru

netcfg (1.118) unstable; urgency=high

  * Fix support for entering an ESSID manually, it was previously
    getting ignored (Closes: #757478). Thanks to James Cowgill for the
    report and the patch!

netcfg (1.117) unstable; urgency=low

  * Add lintian overrides for untranslatable debconf templates. I like
    when packages are lintian-clean...

  [ Updated translations ]
  * Bosnian (bs.po) by Amila Valjevčić
 -- Colin Watson <email address hidden> Thu, 28 Aug 2014 12:42:06 -0700

Changed in netcfg (Ubuntu):
status: New → Fix Released
Revision history for this message
YamakasY (yamakasi-014) wrote :

it seems that this bug is still there ?

Any ideas about this ?

Revision history for this message
Mike Purvis (mikepurvis) wrote :

I tried adding "d-i netcfg/target_network_config string ifupdown" to my preseed file, but I'm still getting /etc/network/interfaces being overwritten by the trusty netboot installer.

Revision history for this message
Leontii Istomin (listomin) wrote :

To avoid this issue you need to add the following line to /var/lib/cobbler/kickstarts/ubuntu-amd64.preseed:
d-i netcfg/target_network_config select ifupdown
I've added the line as 16 string.

build 6.1-192

Revision history for this message
Leontii Istomin (listomin) wrote :

I was wrong the issue can't be fixed using this line:
d-i netcfg/target_network_config select ifupdown

tags: added: scale
Revision history for this message
Mathieu FRAPPIER (mathieu-frappier) wrote :

Here is a quick and dirty workaround to put into a snippet in the preseed_late execution:

cp /etc/network/interfaces /etc/network/interfaces.orig
echo "mv /etc/network/interfaces.orig /etc/network/interfaces && ifup -a && sed -i '/fixnet.sh/d' /etc/rc.local && rm -f /fixnet.sh" > /fixnet.sh
sed -i '/exit 0/ibash /fixnet.sh' /etc/rc.local

Revision history for this message
dayanand (libradayanand) wrote :

For the past months I've installed Ubuntu 14.04 server by using kickstart. In the post-part of the kickstart-script I lounche a shell-script that do some system config, everything has worked fine so fare. Now I've started testing 14.04 and there is one thing that do not work the same way as in 14.04! I rewrite a new /etc/network/interfaces and try to replace the old one, but the old on will not be overwritten or removed. Any one having any sugestions?

Is the above suggestions works??

Revision history for this message
Karthikeyan (karthamb) wrote :

Thanks, Mathieu FRAPPIER. Your solution works for me. But network share is not mounted at first, need to reboot the machine again to see the network share.

Revision history for this message
Karthikeyan (karthamb) wrote :

Added mount -a in your script and its working.

echo "mv /root/interfaces /etc/network/interfaces && ifup -a && sed -i '/fixnet.sh/d' /etc/rc.local && mount -a && rm -f /fixnet.sh" > /fixnet.sh
sed -i '/exit 0/ibash /fixnet.sh' /etc/rc.local
echo NM Disabled >> /root/finished.log

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.