summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xctdb/config/events.d/13.per_ip_routing4
-rwxr-xr-xctdb/config/events.d/20.multipathd11
-rwxr-xr-xctdb/config/events.d/62.cnfs14
3 files changed, 11 insertions, 18 deletions
diff --git a/ctdb/config/events.d/13.per_ip_routing b/ctdb/config/events.d/13.per_ip_routing
index a0df119895..ff4dbdb8c3 100755
--- a/ctdb/config/events.d/13.per_ip_routing
+++ b/ctdb/config/events.d/13.per_ip_routing
@@ -3,8 +3,10 @@
. $CTDB_BASE/functions
loadconfig
+ctdb_setup_service_state_dir "per_ip_routing"
+
[ -z "$CTDB_PER_IP_ROUTING_STATE" ] && {
- CTDB_PER_IP_ROUTING_STATE="$CTDB_VARDIR/state/per_ip_routing"
+ CTDB_PER_IP_ROUTING_STATE="$service_state_dir"
}
AUTO_LINK_LOCAL="no"
diff --git a/ctdb/config/events.d/20.multipathd b/ctdb/config/events.d/20.multipathd
index 73b6054f44..1bf7070fb5 100755
--- a/ctdb/config/events.d/20.multipathd
+++ b/ctdb/config/events.d/20.multipathd
@@ -16,7 +16,9 @@ loadconfig
exit 0
}
-MPFAILURE=$CTDB_VARDIR/state/multipathd/failure
+ctdb_setup_service_state_dir
+
+MPFAILURE="$service_state_dir/failure"
multipathd_check_background()
{
@@ -75,13 +77,6 @@ multipathd_check()
}
case "$1" in
- startup)
- # create a state directory to keep/track the multipath device
- # state
- mkdir -p $CTDB_VARDIR/state/multipathd
- exit 0
- ;;
-
monitor)
multipathd_check
[ "$?" = "0" ] || {
diff --git a/ctdb/config/events.d/62.cnfs b/ctdb/config/events.d/62.cnfs
index af4ecc3b7a..3cc56e3955 100755
--- a/ctdb/config/events.d/62.cnfs
+++ b/ctdb/config/events.d/62.cnfs
@@ -5,13 +5,12 @@
loadconfig
-STATEDIR=$CTDB_VARDIR/state/gpfs
-
+ctdb_setup_service_state_dir "gpfs"
check_if_healthy() {
- mkdir -p $STATEDIR/fs
+ mkdir -p "$service_state_dir/fs"
- [ -f "$STATEDIR/gpfsnoquorum" ] && {
+ [ -f "$service_state_dir/gpfsnoquorum" ] && {
logger No GPFS quorum. Node is UNHEALTHY
$CTDB_BASE/events.d/62.cnfs unhealthy "No GPFS quorum. Nodfe is UNHEALTHY."
exit 0
@@ -23,21 +22,18 @@ check_if_healthy() {
case "$1" in
startup)
- mkdir -p $STATEDIR
check_if_healthy
;;
gpfsquorumreached)
- mkdir -p $STATEDIR
- rm -f "$STATEDIR/gpfsnoquorum"
+ rm -f "$service_state_dir/gpfsnoquorum"
logger "GPFS quorum has been reached."
check_if_healthy
;;
gpfsquorumloss)
- mkdir -p $STATEDIR
- touch "$STATEDIR/gpfsnoquorum"
+ touch "$service_state_dir/gpfsnoquorum"
logger "GPFS quorum has been lost."
$CTDB_BASE/events.d/62.cnfs unhealthy "GPFS quorum was lost! Marking node as UNHEALTHY."
;;