dispatcher issue



I am pulling my hair out with this issue. I am running Fedora 9 (fully updated via yum) with the following packages:

NetworkManager-openvpn-0.7.0-16.svn4027.fc9.i386
NetworkManager-glib-0.7.0-0.11.svn4022.4.fc9.i386
NetworkManager-gnome-0.7.0-0.11.svn4022.4.fc9.i386
NetworkManager-0.7.0-0.11.svn4022.4.fc9.i386
NetworkManager-vpnc-0.7.0-0.10.svn4024.fc9.i386

The problem: I have a script in /etc/NetworkManager/dispatcher.d which calls my firewall script which has rules based on IP and interface information. When I was running Fedora 7 (and which ever version of NetworkManager was in it) it worked as expected - If the wireless came up, it would run the firewall with the wlan info and if I plugged an ethernet cable in, it would run the firewall script with eth0 as the param. If I powered up with the ethernet cable, it would be run accordingly.

In Fedora 9, I can't seem to get any consistancy out of this configuration. If I power up the machine with an ethernet cable attached, the script never runs. If I power up without and let it connect to the wireless, it runs about 90% of the time. If I plug an ethernet cable in after the wireless is up, it still does not run. If it ran 100% of the time for wireless but 0% with ethernet, at least I would have something to go on, but the fact that it doesn't always run for wireless has me baffled.

How can I make this run every time as would be expected with the dispatcher?

Here is the script in dispatcher.d:

------------
/etc/NetworkManager/dispatcher.d/06-firewall

#!/bin/sh
export LC_ALL=C
if [ "$2" = "up" ]; then
    /root/rc.firewall "$1"
fi
-------------

I chose to make it as basic as possible to figure this out. In Fedora 7, I used to have this script and it worked every time (I switched because this script was only executing randomely and I wanted to make sure it wasn't caused by perl):

-------------
#!/usr/bin/perl

my $interface = @ARGV[0];
my $action = "">
if ($action =~ /up/i) {
    my $res = `/root/rc.firewall $interface`;
    my $ip = `/sbin/getip $interface`;
    chomp($ip);
    if ($ip eq "192.168.1.69") {
        $res = `/bin/mount /home/steve/SERVER1/steve`;
        $res = `/bin/mount /home/steve/SERVER1/public`;
        $res = `/bin/mount /home/steve/SERVER1/backup`;
        $res = `/bin/mount /home/steve/DELL/`;
    }
}
--------------

Thanks in advance! I have been pulling my hair out for weeks over this.

-Steve



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]