summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2011-08-08 13:13:59 +1000
committerMartin Schwenke <martin@meltin.net>2011-08-30 09:33:47 +1000
commit9257b57f2c27aef16e442c37d789a882a8870e82 (patch)
tree1ff1f0165ee4882e85f8c73d7607741851a3032b
parent54402cdff4258b77580e702f7718d6d74b155634 (diff)
downloadsamba-9257b57f2c27aef16e442c37d789a882a8870e82.tar.gz
samba-9257b57f2c27aef16e442c37d789a882a8870e82.tar.xz
samba-9257b57f2c27aef16e442c37d789a882a8870e82.zip
Eventscripts: New configuration variable CTDB_SERVICE_AUTOSTARTSTOP.
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> (This used to be ctdb commit ef71b8290ae49117d7bcc7166598b77cb64cc8a0)
-rw-r--r--ctdb/config/ctdb.sysconfig4
-rwxr-xr-xctdb/config/functions3
2 files changed, 7 insertions, 0 deletions
diff --git a/ctdb/config/ctdb.sysconfig b/ctdb/config/ctdb.sysconfig
index 5115094673..163a0dd6ab 100644
--- a/ctdb/config/ctdb.sysconfig
+++ b/ctdb/config/ctdb.sysconfig
@@ -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
diff --git a/ctdb/config/functions b/ctdb/config/functions
index f65690359b..f7ed58a26d 100755
--- a/ctdb/config/functions
+++ b/ctdb/config/functions
@@ -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