Skip to content

Commit

Permalink
Merge pull request #1652 from oalbrigt/LVM-activate-fix-drop-in-check
Browse files Browse the repository at this point in the history
LVM-activate: fix drop-in check to avoid re-creating drop-in file when it already exists
  • Loading branch information
oalbrigt authored Jun 1, 2021
2 parents d0077df + 5729c79 commit 34e75a5
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions heartbeat/LVM-activate
Original file line number Diff line number Diff line change
Expand Up @@ -820,17 +820,14 @@ lvm_start() {
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" \
systemctl show resource-agents-deps.target \
--property=After | cut -d'=' -f2 | \
grep -qE "(^|\s)blk-availability.service(\s|$)"

if [ "$?" -ne 0 ]; then
systemd_drop_in "99-LVM-activate" "After" \
"blk-availability.service"
;;
esac
fi

# If blk-availability isn't started, the "After="
# directive has no effect.
Expand Down

0 comments on commit 34e75a5

Please sign in to comment.