aboutsummaryrefslogtreecommitdiff
path: root/sbin/hastd/secondary.c
diff options
context:
space:
mode:
authorPawel Jakub Dawidek <pjd@FreeBSD.org>2010-08-30 00:12:10 +0000
committerPawel Jakub Dawidek <pjd@FreeBSD.org>2010-08-30 00:12:10 +0000
commit2be8fd75ffb3de15c6c882462e7523bea7b8f528 (patch)
treebee78f72c5d543540f8de0cfe1068e19da62a754 /sbin/hastd/secondary.c
parent6d0c801ea956728a24ba14c5c48aff7b11eb4c27 (diff)
downloadsrc-2be8fd75ffb3de15c6c882462e7523bea7b8f528.tar.gz
src-2be8fd75ffb3de15c6c882462e7523bea7b8f528.zip
Execute hook when split-brain is detected.
MFC after: 2 weeks Obtained from: Wheel Systems Sp. z o.o. http://www.wheelsystems.com
Notes
Notes: svn path=/head/; revision=211983
Diffstat (limited to 'sbin/hastd/secondary.c')
-rw-r--r--sbin/hastd/secondary.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sbin/hastd/secondary.c b/sbin/hastd/secondary.c
index 6051722ed39d..d92030cfb195 100644
--- a/sbin/hastd/secondary.c
+++ b/sbin/hastd/secondary.c
@@ -323,6 +323,7 @@ init_remote(struct hast_resource *res, struct nv *nvin)
if (res->hr_secondary_localcnt > res->hr_primary_remotecnt &&
res->hr_primary_localcnt > res->hr_secondary_remotecnt) {
/* Exit on split-brain. */
+ hook_exec(res->hr_exec, "split-brain", res->hr_name, NULL);
exit(EX_CONFIG);
}
}
@@ -373,6 +374,7 @@ hastd_secondary(struct hast_resource *res, struct nv *nvin)
if (proto_timeout(res->hr_remoteout, res->hr_timeout) < 0)
pjdlog_errno(LOG_WARNING, "Unable to set connection timeout");
+ hook_init();
init_local(res);
init_remote(res, nvin);
init_environment();