Hi all,

here is a patch to properly setup the multicast route for Ganglia in
SuSE. The fix uses also the OCA framework to detect the right distro
release.

Regards,
-Andrea

-- 
Andrea Righi
System Management Group - CINECA - http://www.cineca.it
Via Magnanelli 6/3
40033 Casalecchio di Reno (BO) - Italy
gpg --keyserver pgp.mit.edu --recv-keys 77CEF397
Index: edit_ganglia_conf
===================================================================
--- edit_ganglia_conf	(revision 5130)
+++ edit_ganglia_conf	(working copy)
@@ -34,6 +34,7 @@
 use OSCAR::Configbox;
 use OSCAR::Database;
 use OSCAR::Opkg;
+use OSCAR::OCA::OS_Detect;
 
 my ($do_gmond, $do_gmetad, $image, @options, $test, $verbose);
 GetOptions( 'gmond'   => \$do_gmond,
@@ -366,21 +367,33 @@
     my $static_route_file;
     my $reload_route;
 
-    # FIXME: OCA Framework
-    # Mandriva has a different approach to set and start static routes:
-    if (-e "/etc/mandriva-release") {
+    # use OCA framework to detect the os release.
+    my $os = OSCAR::OCA::OS_Detect::open();
+    my $release = $os->{'compat_distro'};
+
+    # Mandriva and SuSE have a different approach to set and start
+    # static routes:
+    if ($release eq 'mdv') {
 	$route_string = "ADDRESS0=224.0.0.0 NETMASK0=240.0.0.0"; 
 	$static_route_file = "/etc/sysconfig/network-scripts/$iface.route";
+    } elsif ($release eq 'suse') {
+	$route_string = "224.0.0.0/4 0.0.0.0 - $iface"; 
+	$static_route_file = "/etc/sysconfig/network/routes";
     } else {
 	$route_string = "224.0.0.0/4 dev $iface";
     	$static_route_file = "/etc/sysconfig/network-scripts/route-$iface";
     }
 
-    #reload route command, common for both Mandriva and the others distros
-    $reload_route = "/etc/sysconfig/network-scripts/ifup-routes $iface";
+    if ($release eq 'suse') {
+        # SuSE script to reload routes
+        $reload_route = "/etc/sysconfig/network/scripts/ifup-route $iface";
+    } else {
+        #reload route command, common for both Mandriva and the others distros
+        $reload_route = "/etc/sysconfig/network-scripts/ifup-routes $iface";
+    }
 
     # Check to see if multicast route already exists
-    my $mcast_route = `route | grep 224.0.0.0 | grep $iface`;
+    my $mcast_route = `route -n | grep 224.0.0.0 | grep $iface`;
 
     if (!($mcast_route)) {
         if (-e $static_route_file) {
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Oscar-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oscar-devel

Reply via email to