Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
. $LIBDIR/ceph_common.sh
+EXIT_STATUS=0
signal_daemon() {
name=$1
;;
status)
- pid=`cat $pid_file`
- if [ -e /proc/$pid ]; then
- echo "$pid running..."
- exit 0
+ if [ -e "$pid_file" ]; then
+ pid=`cat $pid_file`
+ if [ -e /proc/$pid ]; then
+ echo "$pid running..."
+ else
+ echo "not running: $pid dead"
+ EXIT_STATUS=1
+ fi
+ else
+ echo "not running: no pid file"
+ EXIT_STATUS=1
fi
- exit 1
;;
forcestop)
get_conf pre_forcestop "" "pre forcestop command"
esac
done
-exit 0
+exit $EXIT_STATUS