Bug 902463

Summary: Unable to stop network service
Product: [Fedora] Fedora Reporter: GV <rhel>
Component: initscriptsAssignee: Bill Nottingham <notting>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 18CC: iarlyy, jonathan, lnykryn, notting, plautrba, rhel, rvokal, vpavlin
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-26 02:45:03 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description GV 2013-01-21 18:06:10 UTC
Description of problem:
I'm unable to stop the network service using "service network stop". This has been working fine up to Fedora 17.
if I use "ifdown eth0" everything is fine.

Version-Release number of selected component (if applicable):
initscripts-9.42.1-1.fc18.x86_64

How reproducible:

# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.100  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 2a02:2f02:ZZZZ:ZZZZ:9452:da56:26a8:5be3  prefixlen 64  scopeid 0x0<global>
        inet6 fc00::9452:da56:26a8:5be3  prefixlen 64  scopeid 0x0<global>
        inet6 fe80::21b:38ff:feXX:XXXX  prefixlen 64  scopeid 0x20<link>
        inet6 fc00::100  prefixlen 64  scopeid 0x0<global>
        inet6 2a02:2f02:ZZZZ:ZZZZ:21b:38ff:feXX:XXXX  prefixlen 64  scopeid 0x0<global>
        inet6 fc00::21b:38ff:feXX:XXXX  prefixlen 64  scopeid 0x0<global>
        ether 00:1b:38:XX:XX:XX  txqueuelen 1000  (Ethernet)
        RX packets 251294  bytes 114188706 (108.8 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 142282  bytes 11355700 (10.8 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 22  memory 0xe8020000-e8040000

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 0  (Local Loopback)
        RX packets 436  bytes 21238 (20.7 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 436  bytes 21238 (20.7 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
# ps auxww | grep dhclient | grep -v grep
root      4521  0.0  0.3  94684 12352 ?        Ss   18:49   0:00 /sbin/dhclient -H XXXXX -1 -q -cf /etc/dhcp/dhclient-eth0.conf -lf /var/lib/dhclient/dhclient-624b9858-58db-4bcf-b769-182ca85059de-eth0.lease -pf /var/run/dhclient-eth0.pid eth0
root      4596  0.0  0.3  94684 12532 ?        Ss   18:49   0:00 /sbin/dhclient -6 -1 -cf /etc/dhcp/dhclient6.conf -lf /var/lib/dhclient/dhclient6-624b9858-58db-4bcf-b769-182ca85059de-eth0.lease -pf /var/run/dhclient6-eth0.pid -H XXXXX eth0
# service network stop
Stopping network (via systemctl):                          [  OK  ]
# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.100  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 2a02:2f02:ZZZZ:ZZZZ:9452:da56:26a8:5be3  prefixlen 64  scopeid 0x0<global>
        inet6 fc00::9452:da56:26a8:5be3  prefixlen 64  scopeid 0x0<global>
        inet6 fe80::21b:38ff:feXX:XXXX  prefixlen 64  scopeid 0x20<link>
        inet6 fc00::100  prefixlen 64  scopeid 0x0<global>
        inet6 2a02:2f02:ZZZZ:ZZZZ:21b:38ff:feXX:XXXX  prefixlen 64  scopeid 0x0<global>
        inet6 fc00::21b:38ff:feXX:XXXX  prefixlen 64  scopeid 0x0<global>
        ether 00:1b:38:XX:XX:XX  txqueuelen 1000  (Ethernet)
        RX packets 260249  bytes 118700627 (113.2 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 147127  bytes 11742533 (11.1 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 22  memory 0xe8020000-e8040000
# ps auxww | grep dhclient | grep -v grep
root      4521  0.0  0.3  94684 12736 ?        Ss   18:49   0:00 /sbin/dhclient -H XXXXX -1 -q -cf /etc/dhcp/dhclient-eth0.conf -lf /var/lib/dhclient/dhclient-624b9858-58db-4bcf-b769-182ca85059de-eth0.lease -pf /var/run/dhclient-eth0.pid eth0
root      4596  0.0  0.3  94684 12532 ?        Ss   18:49   0:00 /sbin/dhclient -6 -1 -cf /etc/dhcp/dhclient6.conf -lf /var/lib/dhclient/dhclient6-624b9858-58db-4bcf-b769-182ca85059de-eth0.lease -pf /var/run/dhclient6-eth0.pid -H XXXXX eth0
# ifdown eth0
# ifconfig
# ps auxww | grep dhclient | grep -v grep
#
  
Actual results:
eth0 interface is still up.

Expected results:
eth0 interface is still up.

Additional info:
$cat /etc/sysconfig/network-scripts/ifcfg-eth0
HWADDR=00:1B:38:XX:XX:XX
TYPE=Ethernet
BOOTPROTO=dhcp
DEFROUTE=yes
#PEERDNS=yes
#PEERROUTES=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
#IPV6_AUTOCONF=yes
#IPV6_DEFROUTE=yes
#IPV6_PEERDNS=yes
#IPV6_PEERROUTES=yes
#IPV6_FAILURE_FATAL=no
NAME=eth0
UUID=624b9858-58db-4bcf-b769-182ca85059de
ONBOOT=yes
NOZEROCONF=true
DHCPV6C=yes
DHCPV6C_OPTIONS="-cf /etc/dhcp/dhclient6.conf"
IPV6_PRIVACY=rfc3041

Comment 1 GV 2013-01-21 18:59:19 UTC
I think I found the problem. There is no DEVICE="eth0" in ifcfg-eth0. 

This file was generated by the F18 installer. :-(

/etc/init.d/network need this:
for i in $vpninterfaces $xdslinterfaces $bridgeinterfaces $vlaninterfaces $remaining; do
                (. ./ifcfg-$i
                if [ -z "$DEVICE" ] ; then DEVICE="$i"; fi
.....

By pure chance the /etc/init.d/network script works with only one interface because $DEVICE on line 197 (first for) remain set (second for, line 228).
Once you add a second interface eth1 (with ONBOOT=no) $DEVICE will become eth1 - which is not started - and eth0 remain up.

Comment 2 Václav Pavlín 2013-01-22 11:37:10 UTC
Hi, you are right - the DEVICE variable should be cleared in every iteration of second cycle.

patch commited to upstream -> http://git.fedorahosted.org/cgit/initscripts.git/commit/?h=F18-branch&id=c43e29d76eec6eac857c8774e7fd0fa0a524444f -> post

Will be available with next version of initscripts.

Comment 3 GV 2013-01-22 11:49:40 UTC
How about to print/log a message when DEVICE does not exist in ifcfg-XXXX?

Comment 4 Václav Pavlín 2013-01-22 11:55:46 UTC
I don't think it is necessary - variable DEVICE is resolved from ifcfg script name: 

     if [ -z "$DEVICE" ] ; then DEVICE="$i"; fi

The only proble there was that in $DEVICE remained old value so that the expression DEVICE="$i"; was not applied.

Comment 5 GV 2013-01-22 12:07:54 UTC
You are right. Thank you.

Comment 6 Fedora Update System 2013-02-21 09:08:00 UTC
initscripts-9.42.2-1.fc18, systemd-197-1.fc18.2 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/FEDORA-2013-1590/initscripts-9.42.2-1.fc18,systemd-197-1.fc18.2

Comment 7 Fedora Update System 2013-02-23 01:03:12 UTC
Package initscripts-9.42.2-1.fc18, systemd-197-1.fc18.2:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing initscripts-9.42.2-1.fc18 systemd-197-1.fc18.2'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-1590/initscripts-9.42.2-1.fc18,systemd-197-1.fc18.2
then log in and leave karma (feedback).

Comment 8 Fedora Update System 2013-02-26 02:45:05 UTC
initscripts-9.42.2-1.fc18, systemd-197-1.fc18.2 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.