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

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