Public bug reported:

Running ifup manually with my network configuration gives this error:

# ifup --verbose eth0
Configuring interface eth0=eth0 (inet6)
run-parts --exit-on-error --verbose /etc/network/if-pre-up.d
run-parts: executing /etc/network/if-pre-up.d/ethtool
run-parts: executing /etc/network/if-pre-up.d/wireless-tools
run-parts: executing /etc/network/if-pre-up.d/wpasupplicant
modprobe -q net-pf-10 > /dev/null 2>&1 || true # ignore failure.
sysctl -q -e -w net.ipv6.conf.eth0.use_tempaddr=2
sysctl -q -e -w net.ipv6.conf.eth0.accept_ra=2
sysctl -q -e -w net.ipv6.conf.eth0.autoconf=1
ip link set dev eth0 up
run-parts --exit-on-error --verbose /etc/network/if-up.d
run-parts: executing /etc/network/if-up.d/000resolvconf
run-parts: executing /etc/network/if-up.d/00check-network-cable
/etc/network/if-up.d/00check-network-cable: 72: local: detected:: bad variable 
name
run-parts: /etc/network/if-up.d/00check-network-cable exited with return code 2
Failed to bring up eth0

Running 00check-network-cable with dash -x shows what's happening:

# IFACE=eth0 dash -x 00check-network-cable
+ rc=/etc/default/network-test
+ [ ! -r /etc/default/network-test ]
[snip]
+ check_status_ethtool
+ local status=0
+ grep Link detected
+ /sbin/ethtool eth0
+ local LINK= Link detected: yes
00check-network-cable: 72: local: detected:: bad variable name

The code is saying to define a local variable called "detected:"; this
name comes from the output of the grep in line 72.

The solution is to declare LINK and assign to it in separate steps,
which I do in the attached patch.

I also remove the "true" (:) command from the original:

local LINK=$($ETHTOOL "$IFACE" 2>&1 | grep "Link detected" || :)

because it serves no purpose, as far as I can see.

(See also Debian bug 758798:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=758798 )

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

** Patch added: "00check-network-cable.patch"
   
https://bugs.launchpad.net/bugs/1397965/+attachment/4272043/+files/00check-network-cable.patch

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1397965

Title:
  00check-network-cable fails with bad variable name

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

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to