Hi Bernard,
apparently, Mandriva is now using a similar approach to deal with static routes as Fedora and Rad
Hat. It now uses the same command to reload the route
("/etc/sysconfig/network-scripts/ifup-routes), but the routes are now stored in a file named
<interface>.route, in "/etc/sysconfig/network-scripts/".
I changed the function 'add_multicast_route' from Ganglia's 'edit_ganglia_conf'
file but, before to commit them, I have some issues to discuss:
1) The <interface>.route file that will keep a record of the routes doesn't exists by default
so we can just `echo $route_string >> $static_route_file`. Although that works without
problems, the route string I'm using is 'ADDRESS0=224.0.0.0 NETMASK0=240.0.0.0', and the
"0" that comes after 'ADDRESS' and 'NETMASK' indicates the id of the route. I a special
case where there's already a file with one route configured, the command would replace that route.
2) Ganglia GMOND is restarted *before* the changes in the route, while Ganglia
GMETAD is restarted *after*. To have Ganglia operational, I have to restart
GMOND once Step 3 is finished. Would be possible to incorporate a restart
command for GMOND after the reload of the routes?
You can find the modified version of 'add_multicast_route' below.
Thanks,
Fernando
PS: should I open a ticket for this in the new system?
---------------------------------------------------------------------------------------------------
sub add_multicast_route {
my $route_string;
my $static_route_file;
my $reload_route;
# FIXME: OCA Framework
# There are two different ways to setup static routes, Mandriva uses the
"old" style right now...
if ( (-e "/etc/mandrake-release") || (-e "/etc/mandrakelinux-release") ) {
#$route_string = "any net 224.0.0.0 netmask 240.0.0.0 dev $iface";
$route_string = "ADDRESS0=224.0.0.0 NETMASK0=240.0.0.0";
#$static_route_file = "/etc/sysconfig/static-routes";
$static_route_file = "/etc/sysconfig/network-scripts/$iface.route";
#$reload_route = "service network restart";
#$reload_route = "/etc/sysconfig/network-scripts/ifup-routes $iface";
} else {
$route_string = "224.0.0.0/4 dev $iface";
$static_route_file = "/etc/sysconfig/network-scripts/route-$iface";
#$reload_route = "/etc/sysconfig/network-scripts/ifup-routes $iface";
}
#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`;
if (!($mcast_route)) {
if (-e $static_route_file) {
$mcast_route = `grep 224.0.0.0 $static_route_file`;
}
if (!($mcast_route)) {
opkg_print("Adding default route for multicast to go through
$iface.\n");
`echo $route_string >> $static_route_file`;
}
`$reload_route`;
}
}
---------------------------------------------------------------------------------------------
--
Fernando Laudares Camargos
Révolution Linux
http://www.revolutionlinux.com
---------------------------------------
* Tout opinion et prise de position exprimée dans ce message est celle de son
auteur et pas nécessairement celle de Révolution Linux.
** Any views and opinion presented in this e-mail are solely those of the
author and do not necessarily represent those of Révolution Linux.
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
Oscar-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oscar-devel