Skip to content
Snippets Groups Projects
Commit 6e299c2a authored by Nathaniel Clark's avatar Nathaniel Clark Committed by Oleg Drokin
Browse files

LU-10007 pacemaker: Use lctl and load lustre


When scripts are started, load lustre module.
Use lctl instead of directly accessing health_check file.

Test-Parameters: trivial
Signed-off-by: default avatarNathaniel Clark <nathaniel.l.clark@intel.com>
Change-Id: I4a81248939464e498006dc2c4072d44685add018
Reviewed-on: https://review.whamcloud.com/29144


Tested-by: Jenkins
Reviewed-by: default avatarAndreas Dilger <andreas.dilger@intel.com>
Tested-by: default avatarMaloo <hpdd-maloo@intel.com>
Reviewed-by: default avatarJohn L. Hammond <john.hammond@intel.com>
parent f93276d9
No related branches found
No related tags found
No related merge requests found
......@@ -187,16 +187,20 @@ END
}
ping_start() {
ping_monitor
if [ $? = $OCF_SUCCESS ]; then
return $OCF_SUCCESS
fi
touch ${OCF_RESKEY_pidfile}
ping_update
modprobe lustre
rc=$?
if [ $rc -ne 0 ]; then
return $OCF_ERR_INSTALLED
fi
ping_monitor
if [ $? = $OCF_SUCCESS ]; then
return $OCF_SUCCESS
fi
touch ${OCF_RESKEY_pidfile}
ping_update
}
ping_stop() {
rm -f ${OCF_RESKEY_pidfile}
attrd_updater -D -n $OCF_RESKEY_name -d $OCF_RESKEY_dampen $attrd_options
return $OCF_SUCCESS
......
......@@ -123,6 +123,11 @@ END
}
lustre_start() {
modprobe lustre
rc=$?
if [ $rc -ne 0 ]; then
return $OCF_ERR_INSTALLED
fi
lustre_monitor
if [ $? = $OCF_SUCCESS ]; then
return $OCF_SUCCESS
......@@ -153,12 +158,12 @@ lustre_check() {
active=0
# added head -1 due the LU-7486
l_out=`cat /proc/fs/lustre/health_check | head -1 |grep -w healthy 2>&1`; rc=$?
l_out=`lctl get_param -n health_check | head -1 |grep -w healthy 2>&1`; rc=$?
case $rc in
0) active=`expr $active + 1`;;
1) lustre_conditional_log warn "Lustre is not healthy: $l_out";;
*) ocf_log err "Unexpected result for '/proc/fs/lustre/health_check' $rc: $l_out";;
*) ocf_log err "Unexpected result for 'lctl get_param health_check' $rc: $l_out";;
esac
return $active
}
......@@ -179,13 +184,6 @@ lustre_update() {
return 0
}
if [ ! -f /proc/fs/lustre/health_check ]; then
ocf_log warn "Attention Health_Check file doesn't exist. Lustre will be loaded"
modprobe lustre
fi
if [ ${OCF_RESKEY_CRM_meta_globally_unique} = "false" ]; then
: ${OCF_RESKEY_pidfile:="$HA_VARRUN/healthLUSTRE-${OCF_RESKEY_name}"}
else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment