Bug 682652 - ifdown: line 48: is_nm_device_unmanaged: command not found
Summary: ifdown: line 48: is_nm_device_unmanaged: command not found
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: NetworkManager
Version: 14
Hardware: i686
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Dan Williams
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-03-07 06:23 UTC by George R. Goffe
Modified: 2011-03-18 07:10 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-03-18 07:10:23 UTC
Type: ---


Attachments (Terms of Use)

Description George R. Goffe 2011-03-07 06:23:55 UTC
Description of problem:

ifdown, line 48 references a command(?) named is_nm_device_unmanaged which does not seem to be in my distribution (FC 14).

Version-Release number of selected component (if applicable):

Fully updated FC 14 system

How reproducible:

Happens every time I boot. Network doesn't come up so I have to do "service network restart". The message appears during this process.

Steps to Reproduce:
1.
2.
3.
  
Actual results:

See description.

Expected results:

Network up.

Additional info:

NetworkManager-0.8.3.997-1.fc14.i686



clipper bash-4.1 /tmp# service network restart
Shutting down loopback interface:  ./ifdown: line 48: is_nm_device_unmanaged: command not found
Error: Device 'lo' not found.
                                                           [FAILED]
Bringing up loopback interface:                            [  OK  ]
Bringing up interface eth0:                                [  OK  ]



Here's a copy of my ifdown script from /etc/sysconfig/network-scripts:


    
cat ifdown    
#!/bin/bash

unset WINDOW # defined by screen, conflicts with our usage

. /etc/init.d/functions

cd /etc/sysconfig/network-scripts
. ./network-functions

[ -f ../network ] && . ../network

CONFIG=$1

[ -z "$CONFIG" ] && {
    echo $"usage: ifdown <device name>" >&2
    exit 1
}

need_config "${CONFIG}"

[ -f "$CONFIG" ] || {
    echo $"usage: ifdown <device name>" >&2
    exit 1
}

if [ $UID != 0 ]; then
    if [ -x /usr/sbin/usernetctl ]; then
        source_config
        if /usr/sbin/usernetctl ${CONFIG} report ; then
            exec /usr/sbin/usernetctl ${CONFIG} down
        fi
    fi
    echo $"Users cannot control this device." >&2
    exit 1
fi

source_config

if [ -n "$IN_HOTPLUG" ] && [ "${HOTPLUG}" = "no" -o "${HOTPLUG}" = "NO" ]
then
    exit 0
fi

if [ "$USE_NM" = "true" ]; then
    if [ -n "$UUID" -a -z "$DEVICE" ]; then
        DEVICE=$(nmcli -t --fields uuid,devices con status | awk -F ':' "\$1 == \"$UUID\" { print \$2 }")
    fi
    if [ -n "$DEVICE" ] && ! is_nm_device_unmanaged "$DEVICE" ; then
        nmcli dev disconnect iface "$DEVICE"
        exit $?
    fi
fi

if [ -x /sbin/ifdown-pre-local ]; then
    /sbin/ifdown-pre-local ${DEVICE}
fi

OTHERSCRIPT="/etc/sysconfig/network-scripts/ifdown-${DEVICETYPE}"

if [ ! -x ${OTHERSCRIPT} ]; then
    OTHERSCRIPT="/etc/sysconfig/network-scripts/ifdown-eth"
fi

exec ${OTHERSCRIPT} ${CONFIG} $2

Comment 1 Jirka Klimes 2011-03-09 10:14:25 UTC
What is your version of initscripts?
# rpm -q initscripts

is_nm_device_unmanaged is a function defined in /etc/sysconfig/network-scripts/network-functions

Nonetheless, the problem with not starting a network connection is another issue.
Can you post /etc/sysconfig/network-scripts/ifcfg-eth0 file and /var/log/messages (for NetworkManager logs)?
Output of 'nm-tool' is helpful too.

Comment 2 George R. Goffe 2011-03-11 14:20:44 UTC
Jirka,

Here's the information you requested.

Thanks for your help.

George...

initscripts-9.20.2-1.fc14.1.i686

Comment 3 George R. Goffe 2011-03-11 14:27:16 UTC
Jirka,

I had turned off NetworkManager.

Here's the data (I hope) that you requested.

Regards,

George...

/etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
NM_CONTROLLED=no
ONBOOT=yes
TYPE=Ethernet
BOOTPROTO=none
IPADDR=10.28.0.85
PREFIX=24
GATEWAY=10.28.0.1
DNS1=10.28.0.1
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth0"
UUID=5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03
HWADDR=00:1A:6B:68:15:56
NETMASK=255.255.255.0
USERCTL=no




nm-tool

NetworkManager Tool

State: disconnected

- Device: eth0 -----------------------------------------------------------------
  Type:              Wired
  Driver:            e1000e
  State:             unmanaged
  Default:           no
  HW Address:        00:1A:6B:68:15:56

  Capabilities:
    Carrier Detect:  yes
    Speed:           1000 Mb/s

  Wired Properties
    Carrier:         on


- Device: wlan0 ----------------------------------------------------------------
  Type:              802.11 WiFi
  Driver:            iwl3945
  State:             disconnected
  Default:           no
  HW Address:        00:1B:77:4D:49:91

  Capabilities:

  Wireless Properties
    WEP Encryption:  yes
    WPA Encryption:  yes
    WPA2 Encryption: yes

  Wireless Access Points 
    dietgo2:         Infra, 00:14:BF:29:AA:6B, Freq 2437 MHz, Rate 54 Mb/s, Strength 54 WEP




Mar 11 06:23:03 clipper NetworkManager[5880]: <info> NetworkManager (version 0.8.3.997-1.fc14) is starting...
Mar 11 06:23:03 clipper NetworkManager[5880]: <info> Read config file /etc/NetworkManager/NetworkManager.conf
Mar 11 06:23:03 clipper NetworkManager[5880]: <info> VPN: loaded org.freedesktop.NetworkManager.pptp
Mar 11 06:23:03 clipper NetworkManager[5880]: <info> VPN: loaded org.freedesktop.NetworkManager.openvpn
Mar 11 06:23:03 clipper NetworkManager[5880]: <info> VPN: loaded org.freedesktop.NetworkManager.vpnc
Mar 11 06:23:03 clipper NetworkManager[5880]: <info> VPN: loaded org.freedesktop.NetworkManager.openconnect
Mar 11 06:23:03 clipper NetworkManager[5880]: <info> trying to start the modem manager...
Mar 11 06:23:03 clipper NetworkManager[5880]: <info> monitoring kernel firmware directory '/lib/firmware'.
Mar 11 06:23:03 clipper NetworkManager[5880]:    ifcfg-rh: Acquired D-Bus service com.redhat.ifcfgrh1
Mar 11 06:23:03 clipper NetworkManager[5880]: <info> Loaded plugin ifcfg-rh: (c) 2007 - 2010 Red Hat, Inc.  To report bugs please use the NetworkManager mailing list.
Mar 11 06:23:03 clipper NetworkManager[5880]:    ifcfg-rh: parsing /etc/sysconfig/network-scripts/ifcfg-eth0 ...
Mar 11 06:23:03 clipper NetworkManager[5880]:    ifcfg-rh:     read connection 'System eth0'
Mar 11 06:23:03 clipper NetworkManager[5880]:    ifcfg-rh: Ignoring connection 'System eth0' and its device due to NM_CONTROLLED/BRIDGE/VLAN.
Mar 11 06:23:03 clipper NetworkManager[5880]:    ifcfg-rh: parsing /etc/sysconfig/network-scripts/ifcfg-lo ...
Mar 11 06:23:03 clipper NetworkManager[5880]: <info> found WiFi radio killswitch rfkill2 (at /sys/devices/pci0000:00/0000:00:1c.1/0000:03:00.0/ieee80211/phy0/rfkill2) (driver <unknown>)
Mar 11 06:23:03 clipper NetworkManager[5880]: <info> WiFi enabled by radio killswitch; enabled by state file
Mar 11 06:23:03 clipper NetworkManager[5880]: <info> WWAN enabled by radio killswitch; enabled by state file
Mar 11 06:23:03 clipper NetworkManager[5880]: <info> WiMAX enabled by radio killswitch; enabled by state file
Mar 11 06:23:03 clipper NetworkManager[5880]: <info> Networking is enabled by state file
Mar 11 06:23:03 clipper NetworkManager[5880]: <info> (eth0): carrier is ON
Mar 11 06:23:03 clipper NetworkManager[5880]: <info> (eth0): new Ethernet device (driver: 'e1000e' ifindex: 2)
Mar 11 06:23:03 clipper NetworkManager[5880]: <info> (eth0): exported as /org/freedesktop/NetworkManager/Devices/0
Mar 11 06:23:03 clipper NetworkManager[5880]: <info> (wlan0): driver supports SSID scans (scan_capa 0x01).
Mar 11 06:23:03 clipper NetworkManager[5880]: <info> (wlan0): new 802.11 WiFi device (driver: 'iwl3945' ifindex: 4)
Mar 11 06:23:03 clipper NetworkManager[5880]: <info> (wlan0): exported as /org/freedesktop/NetworkManager/Devices/1
Mar 11 06:23:03 clipper NetworkManager[5880]: <info> (wlan0): now managed
Mar 11 06:23:03 clipper NetworkManager[5880]: <info> (wlan0): device state change: 1 -> 2 (reason 2)
Mar 11 06:23:03 clipper NetworkManager[5880]: <info> (wlan0): bringing up device.
Mar 11 06:23:03 clipper NetworkManager[5880]: <info> (wlan0): preparing device.
Mar 11 06:23:03 clipper NetworkManager[5880]: <info> (wlan0): deactivating device (reason: 2).
Mar 11 06:23:03 clipper NetworkManager[5880]: supplicant_interface_acquire: assertion `mgr_state == NM_SUPPLICANT_MANAGER_STATE_IDLE' failed
Mar 11 06:23:03 clipper NetworkManager[5880]: <warn> /sys/devices/virtual/net/virbr0: couldn't determine device driver; ignoring...
Mar 11 06:23:03 clipper NetworkManager[5880]: <info> modem-manager is now available
Mar 11 06:23:03 clipper NetworkManager[5880]: <info> Trying to start the supplicant...
Mar 11 06:23:04 clipper NetworkManager[5880]: <info> (wlan0): supplicant manager state:  down -> idle
Mar 11 06:23:04 clipper NetworkManager[5880]: <info> (wlan0): device state change: 2 -> 3 (reason 0)
Mar 11 06:23:04 clipper NetworkManager[5880]: <info> (wlan0): supplicant interface state:  starting -> ready

Comment 4 Jirka Klimes 2011-03-14 07:53:56 UTC
Well, the network connection is not activated by NM, because it is marked as unmanaged through the variable NM_CONTROLLED=no.
If you want the eth0 to be controlled by NM, set this to yes or remove it completely from ifcfg-eth0.

Comment 5 George R. Goffe 2011-03-17 03:20:24 UTC
Jirka,

I don't have the time to become NetworkManager "trained". I've found that it changes things that I'm not expecting line resolv.conf.

Shouldn't the initscripts be aware of this situation and adjust their behavior accordingly?

Regards,

George...

Comment 6 Jirka Klimes 2011-03-17 08:10:05 UTC
NetworkManager is simply a replacement for legacy 'network' service.
When you activate NetworkManager, you don't have to use 'network' service and its ifup/ifdown commands (you use nm-applet GUI and/or nmcli command line tool).
However, even if you use ifup/ifdown, initscripts detect that NetworkManager is running and call nmcli internally.
 
resolv.conf is updated by NetworkManager. If you don't use it, resolv.conf can still be updated by dhcliet or other programs.

BTW, your initial report was about missing is_nm_device_unmanaged.
This is a function defined in
/etc/sysconfig/network-scripts/network-functions and should be present in your initscripts version.

Comment 7 George R. Goffe 2011-03-17 10:56:54 UTC
Jirka,

Thanks for the info.

This file does not have the function though. /etc/sysconfig/network-scripts/network-functions

Should this bug be passed to the initscripts people? Here's the version that's on my system now. initscripts-9.20.2-1.fc14.1.i686

What would you recommend?

Regards,

George...

Comment 8 Jirka Klimes 2011-03-17 11:23:48 UTC
I've checked the package and it contains the function in network-functions file, at line 215.
http://kojipkgs.fedoraproject.org/packages/initscripts/9.20.2/1.fc14.1/i686/initscripts-9.20.2-1.fc14.1.i686.rpm

Well, you probably have the installation screwed up. Consider reinstalling initscripts first.

Comment 9 George R. Goffe 2011-03-18 05:16:56 UTC
Jirka,

I am dumfounded.

I did a yum reinstall initscripts and now it's there. I wonder how that could have happened?

Case closed I guess... Unless it happens again.

THANKS for your help.

George...


Note You need to log in before you can comment on or make changes to this bug.