Public bug reported:

Binary package hint: ntop

Ubuntu 8.04, ntop 3:3.2-10.1.

/etc/init.d/ntop has check_interfaces() which includes

    { echo $INTERFACES | awk -F , '{ for(i=1;i<=NF;i++) print $i }' |
    while read iface ; do
        if ! ifconfig "$iface" | grep -w UP >/dev/null; then
            echo "ERR: interface $iface is DOWN..."
            return 1
        fi
    done
    return 0
    }
    return $?

It's called thus.

    echo -n "Starting $DESC: "
    if ! sanity_check || ! check_log_dir || ! check_interfaces; then
        echo " will not start $DESC!"
        exit 1
    fi
    start-stop-daemon --start ...

Running the script with `bash -x' shows it isn't working as intended.

    + ifconfig eth0
    + grep -w UP
    eth0: error fetching interface information: Device not found
    + echo 'ERR: interface eth0 is DOWN...'
    ERR: interface eth0 is DOWN...
    + return 1
    + return 0
    + start-stop-daemon --start --quiet --name ntop --exec /usr/sbin/ntop -- -d 
-L -u ntop -P /var/lib/ntop --skip-version-check -a /var/log/ntop/access.log -i 
eth0 -p /etc/ntop/protocol.list -O /var/log/ntop

There's a `return 1' followed by a `return 0' so the error is getting
cleared with the result that the start-stop-daemon gets to try and start
the ill-configured daemon.  It's probably due to using return inside an
if-statement inside a while-statement and bash subshells.

** Affects: ntop (Ubuntu)
     Importance: Undecided
         Status: New

-- 
/etc/init.d/ntop fails to detect missing network interface
https://bugs.launchpad.net/bugs/231024
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to