]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
add condrestart to the sysvinit script 468/head
authorDan van der Ster <daniel.vanderster@cern.ch>
Fri, 26 Jul 2013 07:36:10 +0000 (09:36 +0200)
committerDan van der Ster <daniel.vanderster@cern.ch>
Fri, 26 Jul 2013 20:20:52 +0000 (22:20 +0200)
We need to be able to condrestart all the ceph services on a
machine, so that we don't restart daemons that are supposed to be
stopped (e.g. broken disks).

Signed-off-by: Dan van der Ster <daniel.vanderster@cern.ch>
src/init-ceph.in

index 8eb02f89214380fa0361816586df26fc64372179..7d003e6370cf4a667cce90ecc704c155c01952d0 100644 (file)
@@ -27,7 +27,7 @@ else
 fi
 
 usage_exit() {
-    echo "usage: $0 [options] {start|stop|restart} [mon|osd|mds]..."
+    echo "usage: $0 [options] {start|stop|restart|condrestart} [mon|osd|mds]..."
     printf "\t-c ceph.conf\n"
     printf "\t--valgrind\trun via valgrind\n"
     printf "\t--hostname [hostname]\toverride hostname lookup\n"
@@ -414,6 +414,15 @@ for name in $what; do
            $0 $options start $name
            ;;
 
+        condrestart)
+            if daemon_is_running $name ceph-$type $id $pid_file; then
+                $0 $options stop $name
+                $0 $options start $name
+            else
+                echo "$name: not running."
+            fi
+            ;;
+
        cleanlogs)
            echo removing logs
            [ -n "$log_dir" ] && do_cmd "rm -f $log_dir/$type.$id.*"