ff7ce6b
diff -up ceph-0.20/src/init-ceph.in.init ceph-0.20/src/init-ceph.in
ff7ce6b
--- ceph-0.20/src/init-ceph.in.init	2010-04-22 16:11:34.000000000 -0400
ff7ce6b
+++ ceph-0.20/src/init-ceph.in	2010-05-05 15:37:11.185677759 -0400
ff7ce6b
@@ -1,10 +1,11 @@
ff7ce6b
 #!/bin/sh
ff7ce6b
 # Start/stop ceph daemons
ff7ce6b
+# chkconfig: - 60 80
ff7ce6b
 
ff7ce6b
 ### BEGIN INIT INFO
ff7ce6b
 # Provides:          ceph
ff7ce6b
-# Default-Start:     2 3 4 5
ff7ce6b
-# Default-Stop:      0 1 6
ff7ce6b
+# Default-Start:
ff7ce6b
+# Default-Stop:
ff7ce6b
 # Required-Start:    $remote_fs $named $network $time
ff7ce6b
 # Required-Stop:     $remote_fs $named $network $time
ff7ce6b
 # Short-Description: Start Ceph distributed file system daemons at boot time
ff7ce6b
@@ -28,6 +29,8 @@ else
ff7ce6b
     fi
ff7ce6b
 fi
ff7ce6b
 
ff7ce6b
+lockfile=/var/lock/subsys/ceph
ff7ce6b
+
ff7ce6b
 usage_exit() {
ff7ce6b
     echo "usage: $0 [options] {start|stop|restart} [mon|osd|mds]..."
ff7ce6b
     printf "\t-c ceph.conf\n"
ff7ce6b
@@ -244,6 +247,7 @@ for name in $what; do
ff7ce6b
 	    [ -n "$pre_start" ] && do_cmd "$pre_start"
ff7ce6b
 	    do_cmd "$cmd" $runarg
ff7ce6b
 	    [ -n "$post_start" ] && do_cmd "$post_start"
ff7ce6b
+	    [ "$?" = 0 ] && touch $lockfile
ff7ce6b
 	    ;;
ff7ce6b
 	
ff7ce6b
 	stop)
ff7ce6b
@@ -252,19 +256,27 @@ for name in $what; do
ff7ce6b
 	    [ -n "$pre_stop" ] && do_cmd "$pre_stop"
ff7ce6b
 	    stop_daemon $name c$type $pid_file
ff7ce6b
 	    [ -n "$post_stop" ] && do_cmd "$post_stop"
ff7ce6b
+	    [ "$?" = 0 ] && rm -f $lockfile
ff7ce6b
 	    ;;
ff7ce6b
 
ff7ce6b
+	status)
ff7ce6b
+	    pid=`cat $pid_file`
ff7ce6b
+	    ps $pid &> /dev/null
ff7ce6b
+	    exit $?
ff7ce6b
+	    ;;
ff7ce6b
 	forcestop)
ff7ce6b
 	    get_conf pre_forcestop "" "pre forcestop command"
ff7ce6b
 	    get_conf post_forcestop "" "post forcestop command"
ff7ce6b
 	    [ -n "$pre_forcestop" ] && do_cmd "$pre_forcestop"
ff7ce6b
 	    stop_daemon $name c$type $pid_file -9
ff7ce6b
 	    [ -n "$post_forcestop" ] && do_cmd "$post_forcestop"
ff7ce6b
+	    [ "$?" = 0 ] && rm -f $lockfile
ff7ce6b
 	    ;;
ff7ce6b
 	    
ff7ce6b
 	killall)
ff7ce6b
 	    echo "killall c$type on $host"
ff7ce6b
 	    do_cmd "pkill ^c$type || true"
ff7ce6b
+	    [ "$?" = 0 ] && rm -f $lockfile
ff7ce6b
 	    ;;
ff7ce6b
 	
ff7ce6b
 	force-reload | reload)