]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
initscripts: fix stop_daemon; add 'forcestop' command
authorSage Weil <sage@newdream.net>
Mon, 2 Mar 2009 18:05:57 +0000 (10:05 -0800)
committerSage Weil <sage@newdream.net>
Mon, 2 Mar 2009 19:10:03 +0000 (11:10 -0800)
src/ceph-daemons

index 7288a118e32aacb7c4a65b8e6eac47d561858ef8..166da5a9bb6709a49dd6a2c13b45ff593a40877e 100755 (executable)
@@ -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