corosync: fix init script
authorVladimir Sorokin <sorokin@altell.ru>
Thu, 24 Jun 2010 08:53:29 +0000 (12:53 +0400)
committerRoman I Khimov <khimov@altell.ru>
Mon, 12 Jul 2010 04:49:53 +0000 (08:49 +0400)
1) use pgrep instead parsing output of "ps"
2) check if nobody needs to kill

Signed-off-by: Vladimir Sorokin <sorokin@altell.ru>
Signed-off-by: Roman I Khimov <khimov@altell.ru>
recipes/corosync/corosync_1.2.6.bb
recipes/corosync/files/init

index 0512148..41287a0 100644 (file)
@@ -1,7 +1,7 @@
 DESCRIPTION = "OSI Certified implementation of a complete cluster engine"
 LICENSE = "BSD"
 
-PR = "r0"
+PR = "r1"
 
 SRC_URI = " \
        ftp://ftp@corosync.org/downloads/corosync-${PV}/corosync-${PV}.tar.gz \
index fc45f43..7277ca9 100644 (file)
@@ -96,7 +96,10 @@ stop() {
        if [ $do_force = 1 ]; then
            echo -n "Escalating... "
            killall -KILL corosync
-           ps | grep /usr/lib/heartbeat | sed "s,^ *,," | cut -f 1 -d ' ' | xargs kill -9
+            pids=`pgrep -f '/usr/lib/heartbeat/*'`
+            if [ -n "$pids" ]; then
+                kill -KILL $pids
+            fi
            sleep 5
 
            if