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