Skip to content

Commit

Permalink
Use command line option for SBD_DELAY_START in sbd.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
krig committed May 17, 2016
1 parent f596a91 commit b20d1dd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/sbd-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ usage(void)
" (default is 5, set to 0 to disable)\n"
"-F <N> # of failures before a servant is considered faulty (optional)\n"
" (default is 1, set to 0 to disable)\n"
"-A Enable start delay (wait for msgwait seconds at start) (optional)\n"
"-A Enable start delay (wait for msgwait seconds at start) (optional)\n"
"-P Check Pacemaker quorum and node health (optional, watch only)\n"
"-Z Enable trace mode. WARNING: UNSAFE FOR PRODUCTION!\n"
"Commands:\n"
Expand Down
6 changes: 3 additions & 3 deletions src/sbd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,16 @@ always) SBD_OPTS+=" -S 0" ;;
clean) SBD_OPTS+=" -S 1" ;;
esac
: ${SBD_DELAY_START:="no"}
if ocf_is_true "$SBD_DELAY_START" ; then
SBD_OPTS+=" -A"
fi

start() {
if ! pidofproc -p $SBD_PIDFILE $SBD_BIN >/dev/null 2>&1 ; then
if ! $SBD_BIN -d $SBD_DEVICE $SBD_OPTS watch ; then
echo "SBD failed to start; aborting."
exit 1
fi
if ocf_is_true ${SBD_DELAY_START} ; then
sleep $(sbd -d "$SBD_DEVICE" dump | grep -m 1 msgwait | awk '{print $4}') 2>/dev/null
fi
else
return 0
fi
Expand Down

0 comments on commit b20d1dd

Please sign in to comment.