• Bug#266175: Changing from dhcp to static IP: dhclient still running

    From CoS@1:229/2 to All on Tue Aug 17 01:40:08 2004
    From: [email protected]

    Package: ifupdown
    Version: 0.6.4-4.9

    1/ After fresh install using dhcp (dhcp worked well and configured the
    machine properly):

    From /etc/network/interfaces:
    auto eth0
    iface eth0 inet dhcp

    2/ I changed the information to a static IP address:

    From /etc/network/interfaces:
    auto eth0
    iface eth0 inet static
    address **.*.75.30
    netmask 255.255.248.0
    gateway **.*.72.1

    3/ and restarted the network using:

    ~# /etc/init.d/networking restart

    which merely does a 'ifdown -a' and then 'ifup -a'.
    At that point the machine works properly with the new static IP.

    4/ My "problem": dhclient is still running and changes the IP after the
    lease ends (after a few days... nice surprise!)

    ~# ps x | grep dhclient
    521 ? Ss 0:00 dhclient -e -pf /var/run/dhclient.eth0.pid -lf /var/run/dhclient.eth0.leases eth0

    I thought it was the right way of doing it (correct me if I am wrong)
    but it definitely doesn't work as expected.

    Indeed, ifdown uses the /etc/network/interfaces file to find the
    method and act accordingly. In this case it would find 'static' and not
    kill the 'dhclient' as in the 'dhcp' method:

    From ifupdown.nw (package source code):
    <<inet methods>>=
    method dhcp
    [...]
    down
    cat /var/run/dhclient.pid | xargs -i kill -TERM {} \
    if (execable("/sbin/dhclient"))
    [...]

    Would it be possible to change the behavior of ifdown (probably '-a'
    case) to check any dhclient running and killing those?
    It would allow for a nice 'networking restart' instead of the stop-configure-start process, which you might want to minimize the
    network downtime!

    Thanks.

    Note: this situation was reproduced several times by switching from one
    to the other configuration.

    --
    CoS


    --
    To UNSUBSCRIBE, email to [email protected]
    with a subject of "unsubscribe". Trouble? Contact [email protected]

    --- SoupGate-Win32 v1.05
    * Origin: you cannot sedate... all the things you hate (1:229/2)