This enhances the
13f38d30a823afc5841fd17ee405c6ebff2af1ac commit by
additionally taking the potential inexistance of pidfiles into account.
Closes: #664621
Reported-by: Michael Prokop <mika@debian.org>
Signed-off-by: Didier Raboud <odyx@debian.org>
fi
if [ -n "${pidfile:-}" ]; then
+ if [ -e "$pidfile" ]; then
if [ -r "$pidfile" ]; then
read pid < "$pidfile"
if [ -n "${pid:-}" ]; then
else
return 4 # pid file not readable, hence status is unknown.
fi
+ else
+ return 3 # pid file doesn't exist, program probably stopped
+ fi
fi
if [ -x /bin/pidof ] && [ ! "$specified" ]; then
status="0"