Skip to content

Commit

Permalink
LVM-activate: Stop before blk-availability.service
Browse files Browse the repository at this point in the history
If storage services (e.g., iscsi-shutdown.service) stop before an
LVM-activate resource stops, the managed VG may become unavailable. Then
the LVM-activate resource may fail to deactivate the volume group and
thus fail its stop operation.

This commit adds a systemd drop-in "After=blk-availability.service"
directive for resource-agents-deps.target during the LVM-activate start
op. blk-availability includes "After=" directives for other storage
services and thus serves as a convenient wrapper.

blk-availability is not enabled by default, and a "Wants=" drop-in
that's created after Pacemaker starts would not be able to start
blk-availability automatically. So here we also start blk-availability
during LVM_start().

Resolves RHBZ#1902208

Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
  • Loading branch information
nrwahl2 committed Nov 30, 2020
1 parent fd55bb4 commit 79fb4b2
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions heartbeat/LVM-activate
Expand Up @@ -830,6 +830,28 @@ lvm_start() {
local rc
local vol

if systemd_is_running ; then
# Create drop-in to deactivate VG before stopping
# storage services during shutdown/reboot.
after=$(systemctl show resource-agents-deps.target.d \
--property=After | cut -d'=' -f2)

case "$after" in
*" blk-availability.service "*)
;;
*)
systemd_drop_in "99-LVM-activate" "After" \
"blk-availability.service"
;;
esac

# If blk-availability isn't started, the "After="
# directive has no effect.
if ! systemctl is-active blk-availability.service ; then
systemctl start blk-availability.service
fi
fi

if lvm_status ; then
ocf_log info "${vol}: is already active."
return $OCF_SUCCESS
Expand Down

0 comments on commit 79fb4b2

Please sign in to comment.