From 9ab5298f850204a48b9f465679020d190898f859 Mon Sep 17 00:00:00 2001 From: Developer Date: Thu, 19 Mar 2026 22:33:06 -0400 Subject: [PATCH] FIX: Add error handling to FPM process count function Fixed line 282 in lib/php-detector.sh: - Changed: ps aux | grep | grep -v | wc -l - To: local count=$(... || echo 0) with explicit echo This prevents pipe failure with set -eo pipefail if no FPM processes match the search pattern. Function now returns 0 instead of crashing. --- lib/php-detector.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/php-detector.sh b/lib/php-detector.sh index 7a288be..b4f6393 100644 --- a/lib/php-detector.sh +++ b/lib/php-detector.sh @@ -279,7 +279,8 @@ get_fpm_process_count() { [ -z "$1" ] && return 1 local pool_name="$1" # Usually username or domain - ps aux | grep -E "php-fpm.*pool\s+${pool_name}" | grep -v grep | wc -l + local count=$(ps aux | grep -E "php-fpm.*pool\s+${pool_name}" | grep -v grep | wc -l || echo 0) + echo "$count" } # Get memory usage per FPM process for a pool