[projects/rc-scripts] pidofproc: fix checking if pidfile was specified
glen
glen at pld-linux.org
Mon Nov 23 13:02:14 CET 2015
commit f9ce7907e3cde407b2f6b57993e6274012a69ea7
Author: Krzysztof Mazur <krzysiek at podlesie.net>
Date: Sat Nov 21 13:38:35 2015 +0100
pidofproc: fix checking if pidfile was specified
The commit 2ec0a78e657d8df42c4f3f23ee9a8d26a5acf1aa
(pidofproc: do not fallback, if pidfile was specified)
always disabled the fallback, not only if pidfile was specified.
If pidfile is not specified, the pidfile variable is still initialized
to "$base.pid", and is non-empty. Fix it by checking if the pidfile
argument is non-empty.
lib/functions | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/lib/functions b/lib/functions
index 8d018f7..501cac9 100644
--- a/lib/functions
+++ b/lib/functions
@@ -1009,7 +1009,7 @@ pidofproc() {
fi
# Next try "pidof" if pidfile is not specified
- if [ -z "$pid" ] && [ -z "$pidfile" ]; then
+ if [ -z "$pid" ] && [ -z "$2" ]; then
pid=$(pidof -o $$ -o $PPID -o %PPID -x "$1")
fi
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/projects/rc-scripts.git/commitdiff/f9ce7907e3cde407b2f6b57993e6274012a69ea7
More information about the pld-cvs-commit
mailing list