summaryrefslogtreecommitdiffstats
path: root/ctdb/server/eventscript.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2010-01-19 10:07:14 +0100
committerStefan Metzmacher <metze@samba.org>2010-01-20 09:44:36 +0100
commitfd06167caa2c194e74c651e1374047213c6cd9d5 (patch)
tree6f9fa814e7ed75169a175edd67b18e0c57b6dd75 /ctdb/server/eventscript.c
parent8456a1b0ef5c6f25c89d289c2ba57cdeeef71f70 (diff)
downloadsamba-fd06167caa2c194e74c651e1374047213c6cd9d5.tar.gz
samba-fd06167caa2c194e74c651e1374047213c6cd9d5.tar.xz
samba-fd06167caa2c194e74c651e1374047213c6cd9d5.zip
server: add "init" event
This is needed because the "startup" event runs after the initial recovery, but we need to do some actions before the initial recovery. metze (This used to be ctdb commit e953808449c102258abb6cba6f4abf486dda3b82)
Diffstat (limited to 'ctdb/server/eventscript.c')
-rw-r--r--ctdb/server/eventscript.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/ctdb/server/eventscript.c b/ctdb/server/eventscript.c
index 9ce9cee484..56e1af50a6 100644
--- a/ctdb/server/eventscript.c
+++ b/ctdb/server/eventscript.c
@@ -589,6 +589,7 @@ static bool check_options(enum ctdb_eventscript_call call, const char *options)
{
switch (call) {
/* These all take no arguments. */
+ case CTDB_EVENT_INIT:
case CTDB_EVENT_STARTUP:
case CTDB_EVENT_START_RECOVERY:
case CTDB_EVENT_RECOVERED:
@@ -649,7 +650,12 @@ static int ctdb_event_script_callback_v(struct ctdb_context *ctdb,
/* we guarantee that only some specifically allowed event scripts are run
while in recovery */
const enum ctdb_eventscript_call allowed_calls[] = {
- CTDB_EVENT_START_RECOVERY, CTDB_EVENT_SHUTDOWN, CTDB_EVENT_RELEASE_IP, CTDB_EVENT_STOPPED };
+ CTDB_EVENT_INIT,
+ CTDB_EVENT_START_RECOVERY,
+ CTDB_EVENT_SHUTDOWN,
+ CTDB_EVENT_RELEASE_IP,
+ CTDB_EVENT_STOPPED
+ };
int i;
for (i=0;i<ARRAY_SIZE(allowed_calls);i++) {
if (call == allowed_calls[i]) break;