From: Sage Weil Date: Mon, 2 Mar 2009 18:05:57 +0000 (-0800) Subject: initscripts: fix stop_daemon; add 'forcestop' command X-Git-Tag: v0.7~81^2~13 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5aa9cc95e05f8dc12d2d76aec6411d128ec21bc8;p=ceph.git initscripts: fix stop_daemon; add 'forcestop' command --- diff --git a/src/ceph-daemons b/src/ceph-daemons index 7288a118e32..166da5a9bb6 100755 --- a/src/ceph-daemons +++ b/src/ceph-daemons @@ -27,12 +27,13 @@ stop_daemon() { name=$1 daemon=$2 pidfile=$3 + signal=$4 echo -n "Stopping ceph $name on $host..." do_cmd "while [ 1 ]; do [ -e $pidfile ] || break - pid=`cat $pidfile` + pid=\`cat $pidfile\` while [ -e /proc/\$pid ] && grep -q $daemon /proc/\$pid/cmdline ; do - cmd=\"kill \$pid\" + cmd=\"kill $signal \$pid\" echo -n \$cmd... \$cmd sleep 1 @@ -115,9 +116,9 @@ for name in $what; do type=`echo $name | cut -c 1-3` # e.g. 'mon', if $item is 'mon1' num=`echo $name | cut -c 4-` sections="$name $type global" -echo $name + check_host || continue -echo $name + get_conf pid_file "/var/run/ceph/$name.pid" "pid file" $sections get_conf conf_file "$runtime_conf" "conf file" $sections @@ -167,6 +168,11 @@ echo $name stop) stop_daemon $name c$type $pid_file ;; + + forcestop) + stop_daemon $name c$type $pid_file -9 + ;; + restart) $0 $options stop $name