[projects/rc-scripts] pidofproc: do not fallback, if pidfile was specified

glen glen at pld-linux.org
Mon May 18 16:01:19 CEST 2015


commit 2ec0a78e657d8df42c4f3f23ee9a8d26a5acf1aa
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Mon May 18 17:01:13 2015 +0300

    pidofproc: do not fallback, if pidfile was specified

 lib/functions | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/lib/functions b/lib/functions
index f337e82..3e111d9 100644
--- a/lib/functions
+++ b/lib/functions
@@ -990,8 +990,8 @@ pidofproc() {
 		done
 	fi
 
-	if [ -z "$pid" ]; then
-		# Next try "pidof"
+	# Next try "pidof" if pidfile is not specified
+	if [ -z "$pid" ] && [ -z "$pidfile" ]; then
 		pid=$(pidof -o $$ -o $PPID -o %PPID -x "$1")
 	fi
 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/projects/rc-scripts.git/commitdiff/2ec0a78e657d8df42c4f3f23ee9a8d26a5acf1aa



More information about the pld-cvs-commit mailing list