Skip to content

Commit

Permalink
Merge pull request #1657 from oalbrigt/lvmlockd-remove-incompatible-c…
Browse files Browse the repository at this point in the history
…mirrord-support

lvmlockd: remove cmirrord support as it's incompatible with lvmlockd
  • Loading branch information
oalbrigt committed Jul 27, 2021
2 parents 75439b1 + c9a5906 commit 58c3d3c
Showing 1 changed file with 1 addition and 37 deletions.
38 changes: 1 addition & 37 deletions heartbeat/lvmlockd
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,11 @@

# Parameter defaults

OCF_RESKEY_with_cmirrord_default="false"
OCF_RESKEY_pidfile_default="/run/lvmlockd.pid"
OCF_RESKEY_socket_path_default="/run/lvm/lvmlockd.socket"
OCF_RESKEY_syslog_priority_default="warning"
OCF_RESKEY_adopt_default="1"

: ${OCF_RESKEY_with_cmirrord=${OCF_RESKEY_with_cmirrord_default}}
: ${OCF_RESKEY_pidfile=${OCF_RESKEY_pidfile_default}}
: ${OCF_RESKEY_socket_path=${OCF_RESKEY_socket_path_default}}
: ${OCF_RESKEY_syslog_priority=${OCF_RESKEY_syslog_priority_default}}
Expand Down Expand Up @@ -73,14 +71,6 @@ For more information, refer to manpage lvmlockd.8.
<shortdesc lang="en">This agent manages the lvmlockd daemon</shortdesc>
<parameters>
<parameter name="with_cmirrord" unique="0" required="0">
<longdesc lang="en">
Start with cmirrord (cluster mirror log daemon).
</longdesc>
<shortdesc lang="en">activate cmirrord</shortdesc>
<content type="boolean" default="${OCF_RESKEY_with_cmirrord_default}" />
</parameter>
<parameter name="pidfile" unique="0">
<longdesc lang="en">pid file</longdesc>
<shortdesc lang="en">pid file</shortdesc>
Expand Down Expand Up @@ -122,7 +112,6 @@ END
#######################################################################

LOCKD="lvmlockd"
CMIRRORD="cmirrord"
# 0.5s sleep each count
TIMEOUT_COUNT=20

Expand Down Expand Up @@ -162,12 +151,6 @@ silent_status()
rc=$?
mirror_rc=$rc

if ocf_is_true $OCF_RESKEY_with_cmirrord; then
pid=$(pgrep $CMIRRORD | head -n1)
daemon_is_running "$pid"
mirror_rc=$?
fi

# If these ever don't match, return error to force recovery
if [ $mirror_rc -ne $rc ]; then
return $OCF_ERR_GENERIC
Expand Down Expand Up @@ -247,16 +230,6 @@ lvmlockd_start() {
return $OCF_SUCCESS
fi

if ocf_is_true $OCF_RESKEY_with_cmirrord; then
ocf_log info "starting ${CMIRRORD}..."
$CMIRRORD
rc=$?
if [ $rc -ne $OCF_SUCCESS ] ; then
ocf_exit_reason "Failed to start ${CMIRRORD}, exit code: $rc"
return $OCF_ERR_GENERIC
fi
fi

if [ ! -z "$OCF_RESKEY_socket_path" ] ; then
extras="$extras -s ${OCF_RESKEY_socket_path}"
fi
Expand Down Expand Up @@ -353,13 +326,8 @@ lvmlockd_stop() {
pid=$(get_pid)
kill_stop $LOCKD $pid

if ocf_is_true $OCF_RESKEY_with_cmirrord; then
pid=$(pgrep $CMIRRORD)
kill_stop $CMIRRORD $pid
fi

if silent_status ; then
ocf_exit_reason "Failed to stop, ${LOCKD} or ${CMIRRORD} still running."
ocf_exit_reason "Failed to stop, ${LOCKD} still running."
return $OCF_ERR_GENERIC
fi

Expand All @@ -382,10 +350,6 @@ lvmlockd_validate() {
check_binary pgrep
check_binary lvmlockctl

if ocf_is_true $OCF_RESKEY_with_cmirrord; then
check_binary $CMIRRORD
fi

return $OCF_SUCCESS
}

Expand Down

0 comments on commit 58c3d3c

Please sign in to comment.