Don't scatter the TEST_LOCAL_DAEMONS logic around the code. Limit it
to the local daemons file.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
(Imported from commit
f05db5edc434da61bc7cd7233c5b9cb61cd888bf)
return 1
}
+# Does nothing on cluster and should be overridden for local daemons
+maybe_stop_ctdb ()
+{
+ :
+}
+
ctdb_restart_when_done ()
{
ctdb_test_restart_scheduled=true
# Do not call ctdb_test_init() here. It will setup ctdb_test_exit()
# to run and that will find the daemons missing and restart them!
-if [ -n "$TEST_LOCAL_DAEMONS" ] && $TEST_CLEANUP ; then
- daemons_stop
-fi
+# We only want to consider stopping CTDB if we're running local
+# daemons. This function will do the right thing.
+maybe_stop_ctdb
daemons_start_1 $i "$@"
done
}
+
+maybe_stop_ctdb ()
+{
+ if $TEST_CLEANUP ; then
+ daemons_stop
+ fi
+}