initscript: wait until we can ping ctdbd before setting tunables.
authorMartin Schwenke <martin@meltin.net>
Thu, 5 Aug 2010 05:29:40 +0000 (15:29 +1000)
committerMartin Schwenke <martin@meltin.net>
Thu, 5 Aug 2010 05:29:40 +0000 (15:29 +1000)
commitcdcd05662a30b51caaeeab4ac44138cac2474e0a
treee2415715e3da8a50cb7262c48d61df6968ed6a1c
parentb93b60ec96d02ce4f54921e85a5c5554d1fc0c55
initscript: wait until we can ping ctdbd before setting tunables.

Currently we do a "sleep 1" after starting and before running
set_ctdb_variables to set the tunables.  This is too arbitrary and
might fail if the system is heavily loaded.  This, for example, could
result in some nodes running with DeterministicIPs and some without,
in which case a different IP allocation algorithm would run depending
on who is the recmaster!

This makes the start function wait until "ctdb ping" succeeds (with 10
second timeout) before trying to run set_ctdb_variables.  If a timeout
occurs then the start function attempts to kill ctdbd before exiting
with a failure.

It also cleans up the status reporting code for Red Hat and SUSE so
that the final status code is reported.  Currently there are cases
where a correct status is prematurely reported before a failure
occurs.

Signed-off-by: Martin Schwenke <martin@meltin.net>
config/ctdb.init