Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-15-SP7:GA
pacemaker.34780
0001-Fix-agents-handle-dampening-parameter-cons...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0001-Fix-agents-handle-dampening-parameter-consistently-a.patch of Package pacemaker.34780
From 1f8e3d6ff66f474c215b4c56f480512e12b08f87 Mon Sep 17 00:00:00 2001 From: Ken Gaillot <kgaillot@redhat.com> Date: Tue, 5 Dec 2023 13:52:05 -0600 Subject: [PATCH] Fix: agents: handle dampening parameter consistently and correctly Always quote variable when used (in case value incorrectly contains whitespace), always use attrd_updater -B instead of -U to ensure dampening is truly reloadable, and always mark parameter as reloadable in metadata. Also, dampening doesn't need to be passed with attrd_updater -D. --- extra/resources/HealthCPU | 9 ++++----- extra/resources/HealthSMART.in | 16 ++++++++-------- extra/resources/ifspeed.in | 20 ++++++++++++-------- extra/resources/ping | 13 ++++--------- 4 files changed, 28 insertions(+), 30 deletions(-) Index: pacemaker-2.1.2+20211124.ada5c3b36/extra/resources/HealthSMART.in =================================================================== --- pacemaker-2.1.2+20211124.ada5c3b36.orig/extra/resources/HealthSMART.in +++ pacemaker-2.1.2+20211124.ada5c3b36/extra/resources/HealthSMART.in @@ -120,25 +120,25 @@ check_temperature() { if [ $1 -lt ${lower_red_limit} ] ; then ocf_log info "Drive ${DRIVE} ${DEVICE} too cold: ${1} C" - "$ATTRDUP" -n "#health-smart" -U "red" -d "5s" + "$ATTRDUP" -n "#health-smart" -B "red" -d "5s" return 1 fi if [ $1 -gt ${upper_red_limit} ] ; then ocf_log info "Drive ${DRIVE} ${DEVICE} too hot: ${1} C" - "$ATTRDUP" -n "#health-smart" -U "red" -d "5s" + "$ATTRDUP" -n "#health-smart" -B "red" -d "5s" return 1 fi if [ $1 -lt ${lower_yellow_limit} ] ; then ocf_log info "Drive ${DRIVE} ${DEVICE} quite cold: ${1} C" - "$ATTRDUP" -n "#health-smart" -U "yellow" -d "5s" + "$ATTRDUP" -n "#health-smart" -B "yellow" -d "5s" return 1 fi if [ $1 -gt ${upper_yellow_limit} ] ; then ocf_log info "Drive ${DRIVE} ${DEVICE} quite hot: ${1} C" - "$ATTRDUP" -n "#health-smart" -U "yellow" -d "5s" + "$ATTRDUP" -n "#health-smart" -B "yellow" -d "5s" return 1 fi } @@ -216,6 +216,9 @@ HealthSMART_start() { HealthSMART_stop() { HealthSMART_monitor + + "$ATTRDUP" -D -n "#health-smart" + if [ $? -eq $OCF_SUCCESS ]; then rm "${OCF_RESKEY_state}" fi @@ -238,14 +241,14 @@ HealthSMART_monitor() { for DEVICE in ${OCF_RESKEY_devices}; do "$SMARTCTL" -d "$DEVICE" -H ${DRIVE} | grep -q "SMART overall-health self-assessment test result: PASSED" if [ $? -ne 0 ]; then - "$ATTRDUP" -n "#health-smart" -U "red" -d "5s" + "$ATTRDUP" -n "#health-smart" -B "red" -d "5s" return $OCF_SUCCESS fi done else "$SMARTCTL" -H "${DRIVE}" | grep -q "SMART overall-health self-assessment test result: PASSED" if [ $? -ne 0 ]; then - "$ATTRDUP" -n "#health-smart" -U "red" -d "5s" + "$ATTRDUP" -n "#health-smart" -B "red" -d "5s" return $OCF_SUCCESS fi fi @@ -266,7 +269,7 @@ HealthSMART_monitor() { fi done - "$ATTRDUP" -n "#health-smart" -U "green" -d "5s" + "$ATTRDUP" -n "#health-smart" -B "green" -d "5s" return $OCF_SUCCESS fi Index: pacemaker-2.1.2+20211124.ada5c3b36/extra/resources/ifspeed.in =================================================================== --- pacemaker-2.1.2+20211124.ada5c3b36.orig/extra/resources/ifspeed.in +++ pacemaker-2.1.2+20211124.ada5c3b36/extra/resources/ifspeed.in @@ -190,7 +190,7 @@ start() { stop() { ha_pseudo_resource "${ha_pseudo_resource_name}" stop - attrd_updater -D -n "${OCF_RESKEY_name}" -d "${OCF_RESKEY_dampen}" ${attrd_options} + attrd_updater -D -n "${OCF_RESKEY_name}" ${attrd_options} return $OCF_SUCCESS } @@ -490,11 +490,7 @@ update() { speed=$( iface_get_speed "${nic}" ) : $(( score = speed * ${OCF_RESKEY_weight_base} / 1000 )) - if [ "$__OCF_ACTION" = "start" ] ; then - attrd_updater -n "${OCF_RESKEY_name}" -B "${score}" -d "${OCF_RESKEY_dampen}" ${attrd_options} - else - attrd_updater -n "${OCF_RESKEY_name}" -v "${score}" -d "${OCF_RESKEY_dampen}" ${attrd_options} - fi + attrd_updater -n "${OCF_RESKEY_name}" -B "${score}" -d "${OCF_RESKEY_dampen}" ${attrd_options} rc=$? case ${rc} in 0) Index: pacemaker-2.1.2+20211124.ada5c3b36/extra/resources/ping =================================================================== --- pacemaker-2.1.2+20211124.ada5c3b36.orig/extra/resources/ping +++ pacemaker-2.1.2+20211124.ada5c3b36/extra/resources/ping @@ -179,7 +179,7 @@ ping_stop() { rm -f "${OCF_RESKEY_pidfile}" - attrd_updater -D -n "$OCF_RESKEY_name" -d "$OCF_RESKEY_dampen" + attrd_updater -D -n "$OCF_RESKEY_name" return $OCF_SUCCESS } @@ -238,8 +238,7 @@ ping_validate() { } ping_reload_agent() { - # No action required - :; + return $OCF_SUCCESS } fping_check() { @@ -320,11 +319,7 @@ ping_update() { fi score=$(expr $active \* $OCF_RESKEY_multiplier) - if [ "$__OCF_ACTION" = "start" ] ; then - attrd_updater -n "$OCF_RESKEY_name" -B "$score" -d "$OCF_RESKEY_dampen" - else - attrd_updater -n "$OCF_RESKEY_name" -v "$score" -d "$OCF_RESKEY_dampen" - fi + attrd_updater -n "$OCF_RESKEY_name" -B "$score" -d "$OCF_RESKEY_dampen" rc=$? case $rc in 0) ping_conditional_log debug "Updated $OCF_RESKEY_name = $score" ;; @@ -424,7 +419,7 @@ start) ping_start;; stop) ping_stop;; monitor) ping_monitor;; validate-all) ping_validate;; -reload-agent) ping_reload_agent;; +reload-agent) ping_reload_agent;; usage|help) ping_usage exit $OCF_SUCCESS ;;
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor