-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

This is for v2 only, against the ldirectord OCF script versioned:
  $VERSION_STR = "Linux Director v1.186-ha-2.1.2";

My goal was to be able to logically break up my ldirectord configs into
groups with the respective IP's for that config using IPaddr2.

So instead of running one big ldirectord instance with 100 different
lvs's, this patche allows me to run 10 instances, each with 10 or so
IP's and its own specific ldirectord config for just those IP's.  This
also makes an active/active system a breeze since half of the groups
should run on one node and the other half should run on the second.
This gives the added bonus of faster failover (because frankly my
biggest issue is how fast the services can be brought back up, currently
it takes about 30 seconds to migrate everything over.)

This patch was hastily tested and it seems to work.  It needs more
testing to make sure that different instances can in no way step on each
other, but I didn't have any conflicts between a second instance with a
config file and the original instance.  No config specified means the
daemon just uses the default config file.  The daemon is smart enough
to embed the config file name in the /var/run/* pid files, so I don't
expect any concurrency issues.


- --- ldirectord.orig  2007-08-10 11:03:07.000000000 +0000
+++ ldirectord       2008-05-08 22:36:02.000000000 +0000
@@ -46,6 +46,7 @@
 #######################################################################
 LDIRECTORD=/usr/sbin/ldirectord
 
+echo "config_file $OCF_RESKEY_config_file" >> /tmp/debug.log
 meta_data() {
        cat <<END
 <?xml version="1.0"?>
@@ -59,7 +60,22 @@
 Be warned: Asking ldirectord status is an expensive action.
 </longdesc>
 <shortdesc lang="en">Wrapper OCF Resource Agent for
ldirectord</shortdesc>
- -<parameters />
+
+<parameters>
+<parameter name="config_file" unique="1" required="0">
+<longdesc lang="en"> 
+You can specify a different config file from the default in the event
+that you want to have groups oriented logically by function or name.
+Only specify the filename, not the full path.  As an example:
+    ldirectord_mysql.cf
+is expected to be located at:
+    /etc/ha.d/conf/ldirectord_mysql.cf
+</longdesc>
+<shortdesc lang="en">Alternate config file</shortdesc>
+<content type="string" default="ldirectord.cf" />
+</parameter>
+</parameters>
+
 <actions>
 <action name="start"   timeout="15" />
 <action name="stop"    timeout="15" />
@@ -86,15 +102,15 @@
 }
 
 ldirectord_start() {
- -    $LDIRECTORD start
+    $LDIRECTORD ${OCF_RESKEY_config_file} start
 }
 
 ldirectord_stop() {
- -    $LDIRECTORD stop
+    $LDIRECTORD ${OCF_RESKEY_config_file} stop
 }
 
 ldirectord_status() {
- -    OUTPUT=`$LDIRECTORD status 2>&1`
+    OUTPUT=`$LDIRECTORD ${OCF_RESKEY_config_file} status 2>&1`
     case $? in
         1)  echo $OUTPUT
             return $OCF_ERR_GENERIC
@@ -112,7 +128,7 @@
 }
 
 ldirectord_monitor() {
- -    OUTPUT=`$LDIRECTORD status 2>&1`
+    OUTPUT=`$LDIRECTORD ${OCF_RESKEY_config_file} status 2>&1`
     case $? in
         0)  return $OCF_SUCCESS
             ;;
 

- -- 
Regards...              Todd
When engineers want simple solutions to complicated social problems,
freedom is the first victim...                      --Stephane Bortzmeyer
Linux kernel 2.6.22-14-generic   6 users,  load average: 0.19, 0.07, 0.02
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFII4OaY2VBGxIDMLwRArB7AKCFxGbYke0pMCSIH4XUyr2/sEvuUgCfRcWq
7bAqWPnWy3idVJfgNuh08+Q=
=AIuo
-----END PGP SIGNATURE-----
_______________________________________________
Linux-HA mailing list
[email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems

Reply via email to