Blame SOURCES/bz1689184-Squid-2-dont-run-pgrep-without-PID.patch

b4b3ce
From e370845f41d39d93f76fa34502d62e2513d5eb73 Mon Sep 17 00:00:00 2001
b4b3ce
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
b4b3ce
Date: Wed, 29 May 2019 14:07:46 +0200
b4b3ce
Subject: [PATCH] Squid: dont run pgrep -P without PID
b4b3ce
b4b3ce
---
b4b3ce
 heartbeat/Squid.in | 4 +++-
b4b3ce
 1 file changed, 3 insertions(+), 1 deletion(-)
b4b3ce
b4b3ce
diff --git a/heartbeat/Squid.in b/heartbeat/Squid.in
b4b3ce
index 0b3c8ea86..e62e7ee66 100644
b4b3ce
--- a/heartbeat/Squid.in
b4b3ce
+++ b/heartbeat/Squid.in
b4b3ce
@@ -173,7 +173,9 @@ get_pids()
b4b3ce
 	SQUID_PIDS[0]=$(pgrep -f "$PROCESS_PATTERN")
b4b3ce
 
b4b3ce
 	# Seek by child process
b4b3ce
-	SQUID_PIDS[1]=$(pgrep -P ${SQUID_PIDS[0]})
b4b3ce
+	if [[ -n "${SQUID_PIDS[0]}" ]]; then
b4b3ce
+		SQUID_PIDS[1]=$(pgrep -P ${SQUID_PIDS[0]})
b4b3ce
+	fi
b4b3ce
 
b4b3ce
 	if [[ -n "${SQUID_PIDS[1]}" ]]; then
b4b3ce
 		typeset exe