initscripts: Fix process check for processes with PID file
Commit Message
This check tests whether a process is still alive, but it fails for
those processes when we are using a PID file.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
---
src/initscripts/system/functions | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
@@ -620,7 +620,11 @@ killproc()
done
if [ -z "${killsig}" ]; then
- pidofproc -s "${1}"
+ if [ -z "${pidfile}" ]; then
+ pidofproc -s "${1}"
+ else
+ pidofproc -s -p "${pidfile}" "${1}"
+ fi
# Program was terminated
if [ "$?" != "0" ]; then