@@ -170,6 +170,9 @@
get_local_name_list
get_name_list "$@"
+running=0
+dead=0
+stopped=0
for name in $what; do
type=`echo $name | cut -c 1-3` # e.g. 'mon', if $item is 'mon1'
id=`echo $name | cut -c 4- | sed 's/^\\.//'`
@@ -375,14 +378,15 @@
if daemon_is_running $name ceph-$type $id $pid_file; then
echo -n "$name: running "
do_cmd "$BINDIR/ceph --admin-daemon $asok version 2>/dev/null" || echo unknown
+ running=1
elif [ -e "$pid_file" ]; then
# daemon is dead, but pid file still exists
echo "$name: dead."
- EXIT_STATUS=1
+ dead=1
else
# daemon is dead, and pid file is gone
echo "$name: not running."
- EXIT_STATUS=3
+ stopped=1
fi
;;
@@ -430,6 +434,16 @@
esac
done
+if [ "$command" = "status" ]; then
+ if [ "$dead" = "1" ]; then
+ EXIT_STATUS=1
+ elif [ "$running" = "1" ]; then
+ EXIT_STATUS=0
+ else
+ EXIT_STATUS=3
+ fi
+fi
+
# activate latent osds?
if [ "$command" = "start" ]; then
if [ "$*" = "" ] || echo $* | grep -q ^osd\$ ; then