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.
This commit is contained in:
+2
-1
@@ -279,7 +279,8 @@ get_fpm_process_count() {
|
|||||||
[ -z "$1" ] && return 1
|
[ -z "$1" ] && return 1
|
||||||
local pool_name="$1" # Usually username or domain
|
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
|
# Get memory usage per FPM process for a pool
|
||||||
|
|||||||
Reference in New Issue
Block a user