Skip to content

Commit

Permalink
LVM-activate: fix drop-in check to avoid re-creating drop-in file whe…
Browse files Browse the repository at this point in the history
…n it already exists
  • Loading branch information
oalbrigt committed May 20, 2021
1 parent 5c54175 commit 5729c79
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 5729c79

Please sign in to comment.