#1120317 ifupdown postinst overwrites /etc/network/interfaces

Package:
ifupdown
Source:
ifupdown
Description:
high level tools to configure network interfaces
Submitter:
Date:
2025-11-08 20:21:01 UTC
Severity:
normal
Tags:
#1120317#5
Date:
2025-11-07 14:20:50 UTC
From:
To:
Hi Mike,

Is this on pure Debian or a derivative? What version of ifupdown?

We have the following in postinst:

    if [ "$1" = "configure" ] ; then
      # We don't need loopback interface definition anymore as
      # ifupdown handles loopback interface on its own from now
      if [ ! -f /etc/network/interfaces ] ; then
        if [ -z "$2" ]; then
          echo "Creating /etc/network/interfaces."
          echo "# interfaces(5) file used by ifup(8) and ifdown(8)" > /etc/network/interfaces
          echo "# Include files from /etc/network/interfaces.d:" >> /etc/network/interfaces
          echo "source /etc/network/interfaces.d/*" >> /etc/network/interfaces
        else
          report_warn "/etc/network/interfaces does not exist"
        fi
      fi
    fi

[ -z "$2" ] is true if we're installing for the first time, not upgrading
which I gather was also true in your case?

[ ! -f /etc/network/interfaces ] should protect an existing config file
here.

This being an on an embedded plantform I wouldn't discount random bitflip
as being the underlying cause ;-) but really we need more clues. Can you
reproduce the problem?

#1120317#14
Date:
2025-11-08 20:19:17 UTC
From:
To:
In answer to your questions, ifupdown    0.8.44.
RaspberryPI Debian GNU/Linux 13 (trixie).

I purged ipupdown then reinstalled and /etc/network/interfaces wasn't
touched, so didn't reproduce the problem.
At some time during my fumbling to get the net up again
/etc/resolv.conf got scrubbed. Don't know how.
I've been running Linux for years and done some programming
professionally which only means I'm not a newby not that
I can't make mistakes.
Likely this is one of them.
Sorry for the noise.
Have a good weekend,
Mike McClain