From 1e991edefec393e008e2a4e236d932eeb49eecca Mon Sep 17 00:00:00 2001 From: Dan van der Ster Date: Fri, 26 Jul 2013 09:36:10 +0200 Subject: [PATCH] add condrestart to the sysvinit script 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 --- src/init-ceph.in | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/init-ceph.in b/src/init-ceph.in index 8eb02f8921438..7d003e6370cf4 100644 --- a/src/init-ceph.in +++ b/src/init-ceph.in @@ -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.*" -- 2.39.5