Eventscripts: New configuration variable CTDB_SERVICE_AUTOSTARTSTOP.
authorMartin Schwenke <martin@meltin.net>
Mon, 8 Aug 2011 03:13:59 +0000 (13:13 +1000)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Mon, 8 Aug 2011 22:01:45 +0000 (08:01 +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 011593d7bcc36f49cd99d8d2b86f6a66c72fe6d6..b0ee47468d01085c7ab3c85716233faec42c24a1 100644 (file)
@@ -286,6 +286,10 @@ CTDB_DEBUGLEVEL=ERR
 # This parameter controls how many entries we allow for this in memory log
 # CTDB_LOG_RINGBUF_SIZE=500000
 
+# 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 94ab8700007f4fb1e95820f8c35d3f2941b21ca4..1f50e70b7cedc715d639119d634e1cbe197fc072 100755 (executable)
@@ -729,6 +729,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