← Back to team overview

touch-packages team mailing list archive

[Bug 1377040] [NEW] /etc/init/network-interface.conf uses ifconfig, should use "ip" instead since ifconfig is deprecated..

 

Public bug reported:

As the summary says
/etc/init/network-interface.conf uses ifconfig but it should use "ip" instead:

This is the line:
ifconfig lo 127.0.0.1 up || true
It probably should be:
ip link set dev lo up || true

This command fails on a clean minimal ubuntu install since net-tools
that provides ifconfig isn't installed.

There should be no need to set ip while bringing the interface up (which
could interfere with future ipv4-only or ipv6-only setups) as the kernel
configures it automatically.

----


cat /etc/init/network-interface.conf 
# network-interface - configure network device
#
# This service causes network devices to be brought up or down as a result
# of hardware being added or removed, including that which isn't ordinarily
# removable.

description     "configure network device"

emits net-device-up
emits net-device-down
emits static-network-up

start on net-device-added
stop on net-device-removed INTERFACE=$INTERFACE

instance $INTERFACE
export INTERFACE

pre-start script
    if [ "$INTERFACE" = lo ]; then
        # bring this up even if /etc/network/interfaces is broken
        ifconfig lo 127.0.0.1 up || true
        initctl emit -n net-device-up \n            IFACE=lo LOGICAL=lo ADDRFAM=inet METHOD=loopback || true
    fi
    mkdir -p /run/network
    exec ifup --allow auto $INTERFACE
end script

post-stop exec ifdown --force --allow auto $INTERFACE

** Affects: ifupdown (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to ifupdown in Ubuntu.
https://bugs.launchpad.net/bugs/1377040

Title:
  /etc/init/network-interface.conf uses ifconfig, should use "ip"
  instead since ifconfig is deprecated..

Status in “ifupdown” package in Ubuntu:
  New

Bug description:
  As the summary says
  /etc/init/network-interface.conf uses ifconfig but it should use "ip" instead:

  This is the line:
  ifconfig lo 127.0.0.1 up || true
  It probably should be:
  ip link set dev lo up || true

  This command fails on a clean minimal ubuntu install since net-tools
  that provides ifconfig isn't installed.

  There should be no need to set ip while bringing the interface up
  (which could interfere with future ipv4-only or ipv6-only setups) as
  the kernel configures it automatically.

  ----

  
  cat /etc/init/network-interface.conf 
  # network-interface - configure network device
  #
  # This service causes network devices to be brought up or down as a result
  # of hardware being added or removed, including that which isn't ordinarily
  # removable.

  description     "configure network device"

  emits net-device-up
  emits net-device-down
  emits static-network-up

  start on net-device-added
  stop on net-device-removed INTERFACE=$INTERFACE

  instance $INTERFACE
  export INTERFACE

  pre-start script
      if [ "$INTERFACE" = lo ]; then
          # bring this up even if /etc/network/interfaces is broken
          ifconfig lo 127.0.0.1 up || true
          initctl emit -n net-device-up \n            IFACE=lo LOGICAL=lo ADDRFAM=inet METHOD=loopback || true
      fi
      mkdir -p /run/network
      exec ifup --allow auto $INTERFACE
  end script

  post-stop exec ifdown --force --allow auto $INTERFACE

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ifupdown/+bug/1377040/+subscriptions


Follow ups

References