Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#639889: ifupdown-extra: 00check-network-cable does not work properly with dash

36 views
Skip to first unread message

Luca Tettamanti

unread,
Aug 31, 2011, 8:20:01 AM8/31/11
to
Package: ifupdown-extra
Version: 0.19
Severity: normal

Dear Maintainer,
00check-network-cable does not work with dash, which starting from
Squeeze is installed as the default /bin/sh. The error reported when
bringing up the interface is:

/etc/network/if-up.d/00check-network-cable: 64: local: detected:: bad variable name
run-parts: /etc/network/if-up.d/00check-network-cable exited with return code 2

The problem seems to be related to the "local" command; the man page
says:

This should appear as the first statement of a function[...]

Changing the function to (moving local declarations at the top):

check_status_ethtool () {
local status=0
local LINK
LINK=`$ETHTOOL $IFACE 2>&1 | grep "Link detected"`

fixes the error, but I'm not 100% sure that it's the correct approach.
Other functions are also affected.

The script works fine when run using bash.


-- System Information:
Debian Release: wheezy/sid
APT prefers unstable
APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 3.0.0-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages ifupdown-extra depends on:
ii bind9-host [host] 1:9.7.3.dfsg-1+b1
ii iproute 20110629-1
ii iputils-arping 3:20101006-1+b1
ii iputils-ping [ping] 3:20101006-1+b1
ii net-tools 1.60-24.1
ii netcat 1.10-39
ii netcat-openbsd [netcat] 1.89-4
ii netcat-traditional [netcat] 1.10-39

Versions of packages ifupdown-extra recommends:
ii ethtool 1:3.0-1

ifupdown-extra suggests no packages.

-- no debconf information

--
To UNSUBSCRIBE, email to debian-bugs-...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org

Luca Tettamanti

unread,
Sep 1, 2011, 5:30:02 PM9/1/11
to
Version 0.20 fixes the problem with dash, however in
check_status_iplink now "/sbin/ip" is executed *before* checking its
existence.

Luca

Javier Fernández-Sanguino Peña

unread,
Sep 4, 2011, 10:00:01 AM9/4/11
to
On Thu, Sep 01, 2011 at 11:25:54PM +0200, Luca Tettamanti wrote:
> Version 0.20 fixes the problem with dash, however in
> check_status_iplink now "/sbin/ip" is executed *before* checking its
> existence.

You are right, thanks for noticing. I have fixed this in GIT and the fix will
be available in the next package upload.

Regards

Javier

signature.asc
0 new messages