eventscripts: Move all eventscript state under $CTDB_VARDIR/state
authorMartin Schwenke <martin@meltin.net>
Wed, 18 Dec 2013 06:08:55 +0000 (17:08 +1100)
committerAmitay Isaacs <amitay@gmail.com>
Mon, 20 Jan 2014 01:31:11 +0000 (12:31 +1100)
Services can be flagged for reconfigure when they release IPs at
shutdown.  The flag is never removed and the service is prematurely
reconfigured during the first "ipreallocated" event, before any IPs
are hosted and before the "startup" event has actually started the
services.

$CTDB_VARDIR/state directly contained the service state subdirectories
and is already removed in the "init" event.  Just push the service
state subdirectories down a level and put everything else in a
subdirectory.

This way all the eventscript state gets cleaned up every time CTDB
starts up.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Fri Jan 17 09:58:26 CET 2014 on sn-devel-104

(Imported from commit b7bfe46636d07c71f83daff884ec339c9b4aee72)

config/functions

index ec9979967ef9de47329f48b0a056e8d35383314f..1aad3ae79b32f08320214b6fe8dc2ea032db6685 100755 (executable)
@@ -986,12 +986,12 @@ ctdb_check_counter () {
 
 ########################################################
 
-ctdb_status_dir="$CTDB_VARDIR/status"
-ctdb_fail_dir="$CTDB_VARDIR/failcount"
+ctdb_status_dir="$CTDB_VARDIR/state/service_status"
+ctdb_fail_dir="$CTDB_VARDIR/state/failcount"
 
 ctdb_setup_service_state_dir ()
 {
-    service_state_dir="$CTDB_VARDIR/state/${1:-${service_name}}"
+    service_state_dir="$CTDB_VARDIR/state/service_state/${1:-${service_name}}"
     mkdir -p "$service_state_dir" || {
        echo "Error creating state dir \"$service_state_dir\""
        exit 1
@@ -1001,7 +1001,7 @@ ctdb_setup_service_state_dir ()
 ########################################################
 # Managed status history, for auto-start/stop
 
-ctdb_managed_dir="$CTDB_VARDIR/managed_history"
+ctdb_managed_dir="$CTDB_VARDIR/state/managed_history"
 
 _ctdb_managed_common ()
 {