Eventscripts: New configuration variable CTDB_SERVICE_AUTOSTARTSTOP.
authorMartin Schwenke <martin@meltin.net>
Mon, 8 Aug 2011 03:13:59 +0000 (13:13 +1000)
committerMartin Schwenke <martin@meltin.net>
Mon, 29 Aug 2011 23:33:47 +0000 (09:33 +1000)
Some of the current auto-start/stop logic is broken, particularly for
Samba.  Fixing it is non-trivial.

If $CTDB_SERVICE_AUTOSTARTSTOP is "yes" then auto-start/stop services
when told to newly manage or no longer manage them.  This defaults to
"yes".

However, if using a canned configuration file that doesn't set
$CTDB_SERVICE_AUTOSTARTSTOP then this stops the auto-start-stop logic
from working.  Therefore, this works around CQ S1026685 - on the
system in question another daemon controls service auto-start/stop and
CTDB just gets in the way.

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

index 51150946730c61916151849df7882b47592826bc..163a0dd6ab599d58ad68faf837b73711dae3549b 100644 (file)
@@ -295,6 +295,10 @@ CTDB_DEBUGLEVEL=ERR
 # above 90%
 # CTDB_CHECK_FS_USE="/:90 /var:90"
 
+# Should CTDB automatically start and stop services when it is told to
+# newly manage or no longer manage them?
+CTDB_SERVICE_AUTOSTARTSTOP=yes
+
 # 
 #
 # set any default tuning options for ctdb
index f65690359b303651f5b44aad7d9f615d42836a75..f7ed58a26d0df0a663c62355177db48f92b70e96 100755 (executable)
@@ -1072,6 +1072,9 @@ is_ctdb_managed_service ()
 
 ctdb_start_stop_service ()
 {
+    # Do nothing unless configured to...
+    [ "$CTDB_SERVICE_AUTOSTARTSTOP" = "yes" ] || return 0
+
     _service_name="${1:-${service_name}}"
 
     [ "$event_name" = "monitor" ] || return 0