Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:15.5:Update
pacemaker.32680
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.32680
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.5+20221208.a3f44794f/extra/resources/HealthCPU =================================================================== --- pacemaker-2.1.5+20221208.a3f44794f.orig/extra/resources/HealthCPU +++ pacemaker-2.1.5+20221208.a3f44794f/extra/resources/HealthCPU @@ -136,8 +136,7 @@ healthcpu_monitor() { } healthcpu_reload_agent() { - # No action required - :; + return $OCF_SUCCESS } healthcpu_validate() { Index: pacemaker-2.1.5+20221208.a3f44794f/extra/resources/HealthSMART.in =================================================================== --- pacemaker-2.1.5+20221208.a3f44794f.orig/extra/resources/HealthSMART.in +++ pacemaker-2.1.5+20221208.a3f44794f/extra/resources/HealthSMART.in @@ -139,25 +139,25 @@ check_temperature() { if [ $1 -lt ${lower_red_limit} ] ; then ocf_log info "Drive ${DRIVE} ${DEVICE} too cold: ${1} C" - attrd_updater -n "#health-smart" -U "red" -d "${OCF_RESKEY_dampen}" + attrd_updater -n "#health-smart" -B "red" -d "${OCF_RESKEY_dampen}" return 1 fi if [ $1 -gt ${upper_red_limit} ] ; then ocf_log info "Drive ${DRIVE} ${DEVICE} too hot: ${1} C" - attrd_updater -n "#health-smart" -U "red" -d "${OCF_RESKEY_dampen}" + attrd_updater -n "#health-smart" -B "red" -d "${OCF_RESKEY_dampen}" return 1 fi if [ $1 -lt ${lower_yellow_limit} ] ; then ocf_log info "Drive ${DRIVE} ${DEVICE} quite cold: ${1} C" - attrd_updater -n "#health-smart" -U "yellow" -d "${OCF_RESKEY_dampen}" + attrd_updater -n "#health-smart" -B "yellow" -d "${OCF_RESKEY_dampen}" return 1 fi if [ $1 -gt ${upper_yellow_limit} ] ; then ocf_log info "Drive ${DRIVE} ${DEVICE} quite hot: ${1} C" - attrd_updater -n "#health-smart" -U "yellow" -d "${OCF_RESKEY_dampen}" + attrd_updater -n "#health-smart" -B "yellow" -d "${OCF_RESKEY_dampen}" return 1 fi } @@ -244,7 +244,7 @@ HealthSMART_start() { } HealthSMART_stop() { - attrd_updater -D -n "#health-smart" -d "${OCF_RESKEY_dampen}" + attrd_updater -D -n "#health-smart" rm "${OCF_RESKEY_state}" @@ -278,7 +278,7 @@ HealthSMART_monitor() { # Check overall S.M.A.R.T. status "${OCF_RESKEY_smartctl}" -d "${DEVICE}" -H ${DRIVE} | grep -q "SMART overall-health self-assessment test result: PASSED" if [ $? -ne 0 ]; then - attrd_updater -n "#health-smart" -U "red" -d "${OCF_RESKEY_dampen}" + attrd_updater -n "#health-smart" -B "red" -d "${OCF_RESKEY_dampen}" return $OCF_SUCCESS fi @@ -290,7 +290,7 @@ HealthSMART_monitor() { else "${OCF_RESKEY_smartctl}" -H "${DRIVE}" | grep -q "SMART overall-health self-assessment test result: PASSED" if [ $? -ne 0 ]; then - attrd_updater -n "#health-smart" -U "red" -d "${OCF_RESKEY_dampen}" + attrd_updater -n "#health-smart" -B "red" -d "${OCF_RESKEY_dampen}" return $OCF_SUCCESS fi @@ -301,7 +301,7 @@ HealthSMART_monitor() { fi done - attrd_updater -n "#health-smart" -U "green" -d "${OCF_RESKEY_dampen}" + attrd_updater -n "#health-smart" -B "green" -d "${OCF_RESKEY_dampen}" return $OCF_SUCCESS fi Index: pacemaker-2.1.5+20221208.a3f44794f/extra/resources/ifspeed.in =================================================================== --- pacemaker-2.1.5+20221208.a3f44794f.orig/extra/resources/ifspeed.in +++ pacemaker-2.1.5+20221208.a3f44794f/extra/resources/ifspeed.in @@ -123,7 +123,7 @@ Can be used to tune how big attribute va <content type="integer" default="${OCF_RESKEY_weight_base_default}"/> </parameter> -<parameter name="dampen"> +<parameter name="dampen" reloadable="1"> <longdesc lang="en"> The time to wait (dampening) for further changes to occur. </longdesc> @@ -147,6 +147,7 @@ Log more verbosely. <action name="monitor" depth="0" timeout="30s" interval="10s"/> <action name="meta-data" timeout="5s" /> <action name="validate-all" timeout="30s" /> +<action name="reload-agent" timeout="20s" /> </actions> </resource-agent> END @@ -154,7 +155,7 @@ END usage() { cat <<END -Usage: $0 {start|stop|monitor|validate-all|meta-data} +Usage: $0 {start|stop|monitor|validate-all|meta-data|reload-agent} Expects to have a fully populated OCF RA-compliant environment set. END @@ -172,7 +173,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 } @@ -489,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) @@ -506,6 +503,10 @@ update() { return ${rc} } +reload_agent() { + return $OCF_SUCCESS +} + case $__OCF_ACTION in meta-data) meta_data @@ -540,6 +541,9 @@ case "$__OCF_ACTION" in validate-all) validate "$OCF_CHECK_LEVEL" ;; + reload-agent) + reload_agent + ;; *) usage exit $OCF_ERR_UNIMPLEMENTED Index: pacemaker-2.1.5+20221208.a3f44794f/extra/resources/ping =================================================================== --- pacemaker-2.1.5+20221208.a3f44794f.orig/extra/resources/ping +++ pacemaker-2.1.5+20221208.a3f44794f/extra/resources/ping @@ -178,7 +178,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 } @@ -237,8 +237,7 @@ ping_validate() { } ping_reload_agent() { - # No action required - :; + return $OCF_SUCCESS } fping_check() { @@ -319,11 +318,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" ;; @@ -423,7 +418,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