# HG changeset patch # User Pascal Bellard # Date 1228174052 0 # Node ID 31520720987c6d798248ff1453036f3c36c9e52e # Parent ea125bdc088879ed0a91c1adda3ef55dce60f9b6 active_pidfile: avoid error msg diff -r ea125bdc0888 -r 31520720987c etc/init.d/rc.functions --- a/etc/init.d/rc.functions Mon Dec 01 22:03:15 2008 +0100 +++ b/etc/init.d/rc.functions Mon Dec 01 23:27:32 2008 +0000 @@ -29,10 +29,12 @@ # Check daemon with pidfile: usage check_pidfile $PIDFILE $DAEMON active_pidfile() { - if grep -qs "Name:.$(basename $2)$" /proc/$(cat $1)/status ; then + if [ ! -e $1 ]; then + return 1 + elif grep -qs "Name:.$(basename $2)$" /proc/$(cat $1)/status ; then return 0 else rm -f $1 - return 1 + return 2 fi }