[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: ifupdown-extra upload to stable-proposed-updates



On Mon, Jun 13, 2011 at 08:21:46PM +0100, Adam D. Barratt wrote:
> On Sun, 2011-06-12 at 23:25 +0200, Javier Fernández-Sanguino Peña wrote:
> > I would like to make an upload to stable in order to fix some bugs in
> > ifupdown-extra which were not detected and fixed in time for the Squeeze
> > release. 
> > 
> > Please find attached the full patch between this new package version and the
> > version 0.14 currently in Squeeze with my proposed changes.

Please find attached the patch to the version I'm going to upload to stable.
The only change with the previous diff I sent is the update of the 
network-test manpage to improve its documentation.

Sorry for the delay, vacation time got in the way :)


Regards

Javier
diff --git a/debian/.changelog.swp b/debian/.changelog.swp
deleted file mode 100644
index a118be8..0000000
Binary files a/debian/.changelog.swp and /dev/null differ
diff --git a/debian/changelog b/debian/changelog
index d894404..583ee29 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,31 @@
+ifupdown-extra (0.14.1) stable; urgency=low
+
+  [ Fold important bug fixes included in 0.15 and later ]
+  * if-up-scripts/check-duplicate-ip: 
+     - Location of ethtool has changed: adjust to the new location but fallback
+       to the old one if it is still there.
+  * if-up-scripts/check-network-cable: Location of ethtool has changed,
+    adjust to the new location but fallback to the old one if it is
+    still there.
+  * if-up-scripts/static-routes: 
+      - Fix typo that prevent the script from adding routes as it expected them
+        to have 'reject' when they shouldn't. Thanks to Mathieu Parent 
+        for the patch. (Closes: #613632) (LP: #631533)
+      - Be strict when looking for routes associated to interface names
+  * scripts/network-test: 
+      - Fix call to mktemp to use --tmpdir so that the script does not break if
+        run in a non-writable directory (Closes: #541619)
+  * debian/ifupdown-extra.preinst: Rename the /etc/network/network-routes
+    config file to /etc/network/routes (Closes: #611982)
+  * debian/rules: 
+      - Fix installation of the network-routes sample configuration file so
+        that it is installed where it should be (/etc/network/routes instead of
+        /etc/network/network-routes) (Closes: #611982)
+  * scripts/network-test.1: Improve the manpage with more documentation
+    of how it works
+
+ -- Javier Fernandez-Sanguino Pen~a <jfs@debian.org>  Sun, 12 Jun 2011 22:29:22 +0200
+
 ifupdown-extra (0.14) unstable; urgency=low
 
   * Apply a patch provided by Guillem Jover to make check-duplicate-ip work
diff --git a/debian/ifupdown-extra.preinst b/debian/ifupdown-extra.preinst
new file mode 100644
index 0000000..3752362
--- /dev/null
+++ b/debian/ifupdown-extra.preinst
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+set -e
+
+
+case "$1" in
+  install|upgrade)
+    if [ -e /etc/network/network-routes ] ; then
+    # There was a bug in the package (<= 0.14). We need to
+    # move the file to the new location
+        mv /etc/network/network-routes /etc/network/routes
+    fi
+  ;;
+esac
+
+
+
+
+# vim:tabstop=2:expandtab:shiftwidth=2
diff --git a/debian/network-routes b/debian/network-routes
index 8c8758b..bca5fab 100644
--- a/debian/network-routes
+++ b/debian/network-routes
@@ -1,8 +1,9 @@
-# This configuration file is read by the static-routes script
-# to setup a list of gateways for a given interface.
+# This configuration file is read by the static-routes if-updown script
+# to setup a list of routes associated either with a given interface or global
+# routes.
 #
-# DO NOT configure default gateway routes here, they should be configured
-# in the /etc/network/interfaces ('gateway' option) instead
+# DO NOT configure default gateway routes for interfaces here, they should be
+# configured in the /etc/network/interfaces ('gateway' option) instead
 #
 # This file includes a list of routes for different networks following
 # the format: # Network Netmask Gateway Interface
diff --git a/debian/rules b/debian/rules
index 1488b63..0ef1726 100755
--- a/debian/rules
+++ b/debian/rules
@@ -47,7 +47,7 @@ install: build
 	dh_clean -k 
 	dh_installdirs
 	# Configuration files
-	install -m644 debian/network-routes  $(CURDIR)/debian/ifupdown-extra/etc/network/network-routes
+	install -m644 debian/network-routes  $(CURDIR)/debian/ifupdown-extra/etc/network/routes
 	install -m644 debian/network-test-default  $(CURDIR)/debian/ifupdown-extra/etc/default/network-test
 	# Network scripts for ifupdown
 	install -m755 if-up-scripts/check-network-cable  $(CURDIR)/debian/ifupdown-extra/etc/network/if-pre-up.d/00check-network-cable
diff --git a/if-up-scripts/check-duplicate-ip b/if-up-scripts/check-duplicate-ip
index b59032b..d48eea6 100755
--- a/if-up-scripts/check-duplicate-ip
+++ b/if-up-scripts/check-duplicate-ip
@@ -37,7 +37,8 @@
 
 # Defaults
 ARPING=/usr/bin/arping
-ETHTOOL=/usr/sbin/ethtool
+ETHTOOL=/sbin/ethtool
+[ ! -x "$ETHTOOL" ] && [ -x "/usr/sbin/ethtool" ] && ETHTOOL=/usr/sbin/ethtool
 ARP_COUNT=${ARP_COUNT:-2}
 ARP_TIMEOUT=${ARP_TIMEOUT:-3}
 DO_SYSLOG=${DO_SYSLOG:-yes}
diff --git a/if-up-scripts/check-gateway b/if-up-scripts/check-gateway
index d5d013a..5f82697 100755
--- a/if-up-scripts/check-gateway
+++ b/if-up-scripts/check-gateway
@@ -42,7 +42,8 @@
 
 # Defaults
 ARPING=/usr/bin/arping
-ETHTOOL=/usr/sbin/ethtool
+ETHTOOL=/sbin/ethtool
+[ ! -x "$ETHTOOL" ] && [ -x "/usr/sbin/ethtool" ] && ETHTOOL=/usr/sbin/ethtool
 ARP_COUNT=${ARP_COUNT:-2}
 ARP_TIMEOUT=${ARP_TIMEOUT:-3}
 DO_SYSLOG=${DO_SYSLOG:-yes}
diff --git a/if-up-scripts/check-network-cable b/if-up-scripts/check-network-cable
index 86faf79..6ee981c 100755
--- a/if-up-scripts/check-network-cable
+++ b/if-up-scripts/check-network-cable
@@ -34,7 +34,8 @@
 [ -r /etc/default/network-test ] && . /etc/default/network-test
 
 # Defaults
-ETHTOOL=/usr/sbin/ethtool
+ETHTOOL=/sbin/ethtool
+[ ! -x "$ETHTOOL" ] && [ -x "/usr/sbin/ethtool" ] && ETHTOOL=/usr/sbin/ethtool
 MIITOOL=/sbin/mii-tool
 DO_SYSLOG=${DO_SYSLOG:-yes}
 ABORT_NO_LINK=i${ABORT_NO_LINK:-no}
diff --git a/if-up-scripts/static-routes b/if-up-scripts/static-routes
index 9f13ae2..79bfdf6 100755
--- a/if-up-scripts/static-routes
+++ b/if-up-scripts/static-routes
@@ -2,6 +2,7 @@
 #
 # Script to setup a system's static routes based on the
 # /etc/network/routes definitions.
+#
 # It tries to simplify network route management and make it easier
 # to handle those as requested in bug #368228 ('Wish: Better Handling 
 # of up/down route commands'). With this script routes do not have to be 
@@ -55,11 +56,14 @@ del_static_routes() {
 	# since they will be removed nevertheless. In any case, this 
 	# piece of code only runs if you install this file in 
 	# /etc/network/if-pre-down.d/ (which you don't need to)
-	cat $ROUTEFILE | egrep "${IFACE}$" | 
+	cat $ROUTEFILE | egrep "^[^#].*[[:space:]]${IFACE}[[:space:]]*$" | 
 	while read network netmask gateway interface ; do
-            if [ -n "$interface" ] && [ -n "$network" ] && [ -n "$netmask" ] && [ "$gateway" = "reject" ] ; then
-                [ "$VERBOSITY" -eq 1 ] && echo "DEBUG: Deleting route for $network / $netmask through gateway $gateway at $interface"
+            if [ -n "$interface" ] && [ -n "$network" ] && [ -n "$netmask" ] && [ -n "$gateway" ] ; then
+                if [ "$gateway" != "reject" ] ; then
+                    [ "$VERBOSITY" -eq 1 ] && echo "DEBUG: Deleting route for $network / $netmask through gateway $gateway at $interface"
                     route del -net $network netmask $netmask gw $gateway dev $interface
+                fi
+
             else
                 echo "ERROR: Incorrect line for $IFACE in $ROUTEFILE: '$network $netmask $gateway $interface'"
             fi
@@ -67,11 +71,14 @@ del_static_routes() {
 }
 
 add_static_routes() {
-	cat $ROUTEFILE | egrep "${IFACE}$" | 
+	cat $ROUTEFILE | egrep "^[^#].*[[:space:]]${IFACE}[[:space:]]*$" | 
 	while read network netmask gateway interface ; do
-            if [ -n "$interface" ] && [ -n "$network" ] && [ -n "$netmask" ] && [ "$gateway" = "reject" ] ; then
-		[ "$VERBOSITY" -eq 1 ] && echo "DEBUG: Adding route for $network / $netmask through gateway $gateway at $interface"
-		route add -net $network netmask $netmask gw $gateway dev $interface
+            if [ -n "$interface" ] && [ -n "$network" ] && [ -n "$netmask" ] && [ -n "$gateway" ] ; then
+                if [ "$gateway" != "reject" ] ; then
+		    [ "$VERBOSITY" -eq 1 ] && echo "DEBUG: Adding route for $network / $netmask through gateway $gateway at $interface"
+        	    route add -net $network netmask $netmask gw $gateway dev $interface
+                fi
+
             else
                 echo "ERROR: Incorrect line for $IFACE in $ROUTEFILE: '$network $netmask $gateway $interface'"
             fi
diff --git a/scripts/network-test b/scripts/network-test
index fb3f950..bd2bb3e 100755
--- a/scripts/network-test
+++ b/scripts/network-test
@@ -414,7 +414,7 @@ check_dns () {
 	status=1
 	nsfound=0
 	nsok=0
-	tempfile=`mktemp tmptestnet.XXXXXX` || {  err "Cannot create temporary file! Aborting! " ; exit 1; }
+	tempfile=`mktemp --tmpdir tmptestnet.XXXXXX` || {  err "Cannot create temporary file! Aborting! " ; exit 1; }
 	trap " [ -f \"$tempfile\" ] && /bin/rm -f -- \"$tempfile\"" 0 1 2 3 13 15
 	cat /etc/resolv.conf | grep -v ^# | grep nameserver | 
 	awk '/nameserver/ { for (i=2;i<=NF;i++) {  print $i ; } }'  >$tempfile
diff --git a/scripts/network-test.1 b/scripts/network-test.1
index df0d57a..66d36c0 100644
--- a/scripts/network-test.1
+++ b/scripts/network-test.1
@@ -1,8 +1,8 @@
 .\" network-test.1 - check the network and test if everything is OK
-.\" Copyright (C) 2006 Javier Fernandez-Sanguino
+.\" Copyright (C) 2006-2011 Javier Fernandez-Sanguino
 .\" Everybody is allowed to distribute this manual page,
 .\" to modify it, and to distribute modifed versions of it.
-.TH network-test 1 "July 24 2006" "debian\-goodies" "debian\-goodies"
+.TH network-test 1 "August 23 2011" "ifupdown\-extra" "ifupdown\-extra"
 .SH NAME
 network-test \- check the network and test if everything is fine
 .SH SYNOPSIS
@@ -12,11 +12,15 @@ The
 .B network-test
 program will test your system's network configuration using basic
 tests and providing both information (\fBINFO\fP), warnings (\fBWARN\fP)
-and possible errors (\fBERR\fP) by checking:
+and possible errors (\fBERR\fP) based on the results of these tests.
+It will check and report on:
 .RS
-* Interface status, number of transmitted packets and error rates.
+* Status of the network interfaces of the system including: link status, 
+ IP addressing and number of transmitted packets and error rates.
 
-* Availability of configured routers, including the default router.
+* Accessibility to configured routes to external networks, 
+  including the default network route, checking the availability of the
+  routers configured to give access to these networks
 
 * Proper host resolution, testing DNS resolution against a known host.
 
@@ -26,9 +30,23 @@ used for the tests can be configured through the environment, see below)
 .RE
 
 .P 
-The script does not need special privileges to run as it does not
+The program does not need special privileges to run as it does not
 do any system change. 
 
+However, the behaviour of the program when running as an unprivileged user is
+not the same as running as system administrator (i.e. root). If the
+program is run as system administrator it will try to run some tools
+that are only available to it to speed up some of the tests.
+
+.P
+The program relies on the use of \fBip\fR, \fBnetstat\fR, \fBifconfig\fR,
+\fBarp\fR and (when running as root) \fBethtool\fR or \fBmii-tool\fR, to obtain
+information about the system's networking configuration (status of
+available interfaces and configured network routes). It also uses
+\fBping\fR, \fBhost\fR and \fBnc\fR (netcat) to do tests of the network
+connectivity and ensure that the host can connect to the Internet.
+
+
 .SH ENVIRONMENT
 
 The program will, by default, check 
@@ -61,9 +79,36 @@ This program does not have \fIsuper cow powers\fP so it is unable to fix the
 errors by itself. It is also unable to detect if the network is failing due to
 a local firewall policy been in place so make sure you check your system logs
 with
-.B dmesg(1)
+.B dmesg (1)
+to detect if some of the active tests are being dropped due to your local
+firewall.
+
+Other known issues that might make the program not work reliable are:
+
+.RS
+* IPv6: The program does not yet explicitly handle IPv6 only hosts, some of the
+tests might be biased towards IPv4 and might fail in IPv6 environments.
+
+* Proxies: The program does not check network connectivity for hosts that
+connect through the Internet using a proxy gateway for services. The program
+might report issues in hosts using proxies even when these might 
+connect to the Internet properly through proxied services.
+
+* Firewall environments: some of the tests rely on direct connectivity
+to external hosts, which are tested using ICMP queries (through the use of
+\fBping\fR. These tests might fail in hosts installed in networking
+environments with firewalls that block outbound ICMP communication.
+.RE
 
-.\".SH  SEE ALSO
+.SH  SEE ALSO
+.B ip (8),
+.B netstat (8),
+.B ifconfig (8),
+.B ethtool (8),
+.B mii-tool (8),
+.B ping (8),
+.B nc (1) and
+.B host (1).
 
 .SH AUTHOR
 
@@ -73,7 +118,7 @@ GNU/Linux distribution.
 
 .SH COPYRIGHT AND LICENCE
 
-Copyright (C) 2005,2006 Javier Fernandez-Sanguino <jfs@debian.org>.
+Copyright (C) 2005-2011 Javier Fernandez-Sanguino <jfs@debian.org>.
 
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by

Attachment: signature.asc
Description: Digital signature


Reply to: