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>
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 \
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