Skip to content

Commit

Permalink
LVM Agents: Warn instead of fail if initrd is newer than lvm.conf
Browse files Browse the repository at this point in the history
There are many reasons why a user may change the lvm.conf file.  They might
change filters or default segment types, etc.  Making the HA LVM scripts
error our every time the lvm.conf file is newer than the initrd, can cause
serious problems.  For example, if a service is running and lvm.conf is
changed, a subsequent fail-over would not work because the HA LVM script
would abort on this condition.

Instead of making things potentially worse, we have the scripts warn the
user (rather than failing) whenever this condition is hit.  That way,
the user isn't suddenly surprised by things not working.

Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
  • Loading branch information
jbrassow committed Oct 5, 2012
1 parent 615182e commit 414431e
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions rgmanager/src/resources/lvm.sh
Expand Up @@ -107,7 +107,12 @@ function ha_lvm_proper_setup_check
if [ "$(find /boot -name *.img -newer /etc/lvm/lvm.conf)" == "" ]; then
ocf_log err "HA LVM: Improper setup detected"
ocf_log err "* initrd image needs to be newer than lvm.conf"
return $OCF_ERR_GENERIC

# While dangerous if not done the first time, there are many
# cases where we don't simply want to fail here. Instead,
# keep warning until the user remakes the initrd - or has
# it done for them by upgrading the kernel.
#return $OCF_ERR_GENERIC
fi

return $OCF_SUCCESS
Expand Down Expand Up @@ -139,9 +144,7 @@ status|monitor)
;;

stop)
if ! ha_lvm_proper_setup_check; then
ocf_log err "WARNING: An improper setup can cause data corruption!"
fi
ha_lvm_proper_setup_check

if [ -z $OCF_RESKEY_lv_name ]; then
vg_stop || exit 1
Expand Down

0 comments on commit 414431e

Please sign in to comment.