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.
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