From 20920d818d785137888facc07b84771ded2a70c2 Mon Sep 17 00:00:00 2001
From: Marcin Krol <hawk@tld-linux.org>
Date: Tue, 21 May 2024 20:49:01 +0200
Subject: [PATCH] - PLD merge: don't delete base pidfile if other pid file was
 specified

---
 lib/functions | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lib/functions b/lib/functions
index 25803f6..b4c4840 100644
--- a/lib/functions
+++ b/lib/functions
@@ -896,7 +896,11 @@ killproc() {
 
 	# Remove pid file if any.
 	if [ "$notset" = "1" ]; then
-		rm -f /var/run/${base}.pid
+		if [ -f "${pidfile}" ] ; then
+			rm -f "$pidfile"
+		else
+			rm -f /var/run/${base}.pid
+		fi
 	fi
 
 	return $result
-- 
2.49.0