Hide Forgot
Description of problem: * A "# service network stop" tries to stop already stopped interfaces when a 'tunnel' interface is present. Version-Release number of selected component (if applicable): * initscripts-9.03.49-1.el6_7.4.x86_64 How reproducible: * Always Steps to Reproduce: 0. Test this reproducer in a system with several eth interfaces defined in /etc/sysconfig/network-scripts. Even if your system has just a single ethernet attached to it. 1. Start your network; 2. Start a tunnel interface (defined by /etc/sysconfig/network-scripts/ifcfg-tunnel(x) 3. Set a verbose bash -x output in your /etc/init.d/network 4. Stop the network Actual results: * The function check_device_down will use tunnel0 as a reference interface (which is up) and the network script will try to stop every interface in the system, regardless if it actually exists or is up. Expected results: * check_device_down should check the correct interface and down/skip accordingly. Additional info: See bad-output.txt line 177 - 188. It uses tunnel0 as reference to stop eth0. Going further, see lines 224 - 237, trying to shutdown a non-existent interface. Fixed script: See good-output.txt.
Created attachment 1133382 [details] Script misbehaviour
Created attachment 1133383 [details] Script working correctly
Created attachment 1133384 [details] Patch: initscripts: Fixes interface enumeration on shutdown test
Post: https://lists.fedorahosted.org/archives/list/initscripts-devel@lists.fedorahosted.org/thread/4Q5HHDJOJNO42HOCVA7LFVJLS5UNKWAF/
Thanks for those patches, I will review them as soon as possible. (I keep post status for the bugs that are already committed in upstream git)
Created attachment 1133824 [details] [PATCH] network: Fixes ifdown var leak, add tunnel treatment Lukáš Nykrýn píše v Po 07. 03. 2016 v 12:35 +0100: > Hello, > > I don't think this patch is correct. I can have for example vlan > eth0.10 and in configuration in file ifcfg-myvlan, with this patch > the device would not be pulled down. > > This is totally untested guess, but I think that correct fix would be: > > diff --git a/rc.d/init.d/network b/rc.d/init.d/network > index cbb9ddf..8cf851d 100755 > --- a/rc.d/init.d/network > +++ b/rc.d/init.d/network > @@ -204,6 +204,7 @@ case "$1" in > done > > for i in $xdslinterfaces $bridgeinterfaces $vlaninterfaces > $remaining; do > + unset DEVICE > (. ./ifcfg-$i > if [ -z "$DEVICE" ] ; then DEVICE="$i"; fi You are right. Very well spotted, Lukas. I rewrote the patch containing your suggestion and it now works accordingly, even with the scenario that you described. [root@rf network-scripts]# service network start Bringing up loopback interface: [ OK ] Bringing up interface eth0: Active connection state: activated Active connection path: /org/freedesktop/NetworkManager/ActiveConnection/6 [ OK ] Bringing up interface myvlan: Determining if ip address 192.168.2.1 is already in use for device eth0.1... [ OK ] [root@rf network-scripts]# [root@rf network-scripts]# [root@rf network-scripts]# ifup tunnel0 [root@rf network-scripts]# [root@rf network-scripts]# [root@rf network-scripts]# service network stop Shutting down interface tunnel0: [ OK ] Shutting down interface myvlan: [ OK ] Shutting down interface eth0: Device state: 3 (disconnected) [ OK ] Shutting down interface eth1: [ OK ] Shutting down loopback interface: [ OK ]
Created attachment 1133835 [details] [PATCH] network: Fixes ifdown var leak, add tunnel treatment Renamed %s/tunnelinterface/vpninterface/g.
Devel_Ack for mentioned patch for 6.9.
The changes proposed by Rodrigo Freire have been commited ~8 months ago: https://github.com/fedora-sysv/initscripts/commit/82c97b4ac121269ecb829
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHBA-2017-0786.html