From 64a4ce85f8f5034a39a702f5fd4acbc479a90338 Mon Sep 17 00:00:00 2001 From: bixiaoyan Date: Fri, 31 May 2024 17:06:20 +0800 Subject: [PATCH] Mid: storage-mon: Add logging to daemon mode. --- ...orage-mon-Add-logging-to-daemon-mode.patch | 34 +++++++++++++++++++ resource-agents.spec | 6 +++- 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 backport-Mid-storage-mon-Add-logging-to-daemon-mode.patch diff --git a/backport-Mid-storage-mon-Add-logging-to-daemon-mode.patch b/backport-Mid-storage-mon-Add-logging-to-daemon-mode.patch new file mode 100644 index 0000000..423eb82 --- /dev/null +++ b/backport-Mid-storage-mon-Add-logging-to-daemon-mode.patch @@ -0,0 +1,34 @@ +From 9032181967ea9c5c985e346c51bca6b9997d7287 Mon Sep 17 00:00:00 2001 +From: Hideo Yamauchi +Date: Mon, 27 May 2024 18:12:01 +0900 +Subject: [PATCH] Mid: storage-mon: Add logging to daemon mode. + +--- + tools/storage_mon.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/tools/storage_mon.c b/tools/storage_mon.c +index a9227ef9..f94268f6 100644 +--- a/tools/storage_mon.c ++++ b/tools/storage_mon.c +@@ -308,6 +308,8 @@ static int32_t sigchld_handler(int32_t sig, void *data) + /* so add the final_score from the exit code of the terminated child process. */ + if (qb_loop_timer_is_running(storage_mon_poll_handle, expire_handle)) { + if (WEXITSTATUS(status) !=0) { ++ syslog(LOG_ERR, "Error reading from device %s", devices[index]); ++ + final_score += scores[index]; + + /* Update response values immediately in preparation for inquiries from clients. */ +@@ -403,6 +405,8 @@ static void child_timeout_handler(void *data) + if (is_child_runnning()) { + for (i=0; i 0) { ++ syslog(LOG_ERR, "Reading from device %s did not complete in %d seconds timeout", devices[i], timeout); ++ + /* If timeout occurs before SIGCHLD, add child process failure score to final_score. */ + final_score += scores[i]; + +-- +2.25.1 + diff --git a/resource-agents.spec b/resource-agents.spec index 1a5cfd0..0913937 100644 --- a/resource-agents.spec +++ b/resource-agents.spec @@ -1,7 +1,7 @@ Name: resource-agents Summary: Open Source HA Reusable Cluster Resource Scripts Version: 4.13.0 -Release: 24 +Release: 25 License: GPLv2+ and LGPLv2+ URL: https://github.com/ClusterLabs/resource-agents Source0: https://github.com/ClusterLabs/resource-agents/archive/v%{version}.tar.gz @@ -29,6 +29,7 @@ Patch0020: Filesystem-fail-when-incorrect-device-mounted-on-mou.patch Patch0021: ocf-shellfuncs-add-curl_retry.patch Patch0022: aws-vpc-move-ip-aws-vpc-route53-awseip-awsvip-add-au.patch Patch0023: AWS-agents-use-curl_retry.patch +Patch0024: backport-Mid-storage-mon-Add-logging-to-daemon-mode.patch Obsoletes: heartbeat-resources <= %{version} Provides: heartbeat-resources = %{version} @@ -127,6 +128,9 @@ export CFLAGS="$(echo '%{optflags}')" %{_mandir}/man8/{ocf-tester.8*,ldirectord.8*} %changelog +* Fri May 31 2024 bixiaoyan - 4.13.0-25 +- Mid: storage-mon: Add logging to daemon mode. + * Tue May 07 2024 bizhiyuan - 4.13.0-24 - AWS agents: use curl_retry() -- Gitee