[PATCH] ifupdown: post-down scripts don't get called when avahi-autoipd is used

Denys Vlasenko vda.linux at googlemail.com
Thu Apr 22 04:12:54 UTC 2010


On Wed, Apr 21, 2010 at 11:16 AM,  <jeroen.dewachter at barco.com> wrote:
> From: Jeroen De Wachter <jedw at sleipner.barco.com>
>
> when ifdown gets called on a configuration that uses DHCP, it
> kills the udhcpc client by killing the process with the id in
> the udhcpc pid file (/var/run/udhcpc.%iface%.pid)
>
> However, when avahi-autoipd is in play, that pid file does not
> exist (due to a modified /usr/share/udhcpc/default.script that
> launches the avahi autoipd stuff) and killing the process
> fails.
>
> Due to the way iface_down is written:
>
> static int iface_down(struct interface_defn_t *iface)
> {
>    if (!iface->method->down(iface,check)) return -1;
>    set_environ(iface, "stop");
>    if (!execute_all(iface, "down")) return 0;
>    if (!iface->method->down(iface, doit)) return 0; // <-- returns prematurely
>    if (!execute_all(iface, "post-down")) return 0;
>    return 1;
> }
>
> the post-down scripts are no longer executed, even though
> nothing has actually gone wrong...

I do not want to add more special cases to ifupdown.
There is a potentially infinite number of them.
Use something better than ifupdown.
-- 
vda


More information about the busybox mailing list