From d907144ca66cfda5c5069f5179cc0af13c0f403e Mon Sep 17 00:00:00 2001 From: zouzhimin Date: Sun, 28 Apr 2024 16:52:38 +0800 Subject: [PATCH] Fix: cibsecret: Use 'ps axww' to avoid truncating issue (cherry picked from commit 636afb638da94102fd4ee3709ad1cc9edf23b889) --- ...se-ps-axww-to-avoid-truncating-issue.patch | 37 +++++++++++++++++++ pacemaker.spec | 6 ++- 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 Fix-cibsecret-Use-ps-axww-to-avoid-truncating-issue.patch diff --git a/Fix-cibsecret-Use-ps-axww-to-avoid-truncating-issue.patch b/Fix-cibsecret-Use-ps-axww-to-avoid-truncating-issue.patch new file mode 100644 index 0000000..1b9c9b1 --- /dev/null +++ b/Fix-cibsecret-Use-ps-axww-to-avoid-truncating-issue.patch @@ -0,0 +1,37 @@ +From 581e1bf3850a5e6a972ea02198bbbf2d99b29873 Mon Sep 17 00:00:00 2001 +From: xin liang +Date: Wed, 6 Mar 2024 17:07:16 +0800 +Subject: [PATCH] Fix: cibsecret: Use 'ps axww' to avoid truncating issue + +When python program calling cibsecret with a small terminal width, +the command `ps -ef | grep '[p]acemaker-controld'` will return 1, see + +>>> cmd = "ps -ef | grep '[p]acemaker-controld' >/dev/null" +>>> # When terminal width is small +>>> subprocess.call(cmd, shell=True) +1 +>>> # When terminal is big enough +>>> subprocess.call(cmd, shell=True) +0 + +Use 'ps axww' can avoid this issue, also for BSD environment. +--- + tools/cibsecret.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tools/cibsecret.in b/tools/cibsecret.in +index 4569863af..9df420126 100644 +--- a/tools/cibsecret.in ++++ b/tools/cibsecret.in +@@ -171,7 +171,7 @@ check_env() { + else + fatal $CRM_EX_NOT_INSTALLED "please install pssh, pdsh, or ssh to run $PROG" + fi +- ps -ef | grep '[p]acemaker-controld' >/dev/null || ++ ps axww | grep '[p]acemaker-controld' >/dev/null || + fatal $CRM_EX_UNAVAILABLE "pacemaker not running? $PROG needs pacemaker" + } + +-- +2.25.1 + diff --git a/pacemaker.spec b/pacemaker.spec index 2abe636..071df68 100644 --- a/pacemaker.spec +++ b/pacemaker.spec @@ -17,7 +17,7 @@ ## can be incremented to build packages reliably considered "newer" ## than previously built packages with the same pcmkversion) %global pcmkversion 2.1.7 -%global specversion 8 +%global specversion 9 ## Upstream commit (full commit ID, abbreviated commit ID, or tag) to build %global commit 0f7f88312f7a1ccedee60bf768aba79ee13d41e0 @@ -154,6 +154,7 @@ Patch1: 001-schema-glib.patch Patch2: Doc-HealthSMART-fix-the-description-of-temp_lower.patch Patch3: 002-schema-transfer.patch Patch4: Improve-pacemaker-attrd-cache-management-and-logging.patch +Patch5: Fix-cibsecret-Use-ps-axww-to-avoid-truncating-issue.patch Requires: resource-agents Requires: %{pkgname_pcmk_libs} = %{version}-%{release} @@ -761,6 +762,9 @@ exit 0 %license %{nagios_name}-%{nagios_hash}/COPYING %changelog +* Sun Apr 28 2024 zouzhimin - 2.1.7-9 +- Fix: cibsecret: Use 'ps axww' to avoid truncating issue + * Mon Apr 01 2024 zouzhimin - 2.1.7-8 - Fixed the warning message during installation of pacemaker-cli -- Gitee