local cmd="$3"
if [ -f "$pidfile" ]; then
- if kill -0 `cat $pidfile`; then
+ if ps p `cat $pidfile` >/dev/null 2>&1; then
return 0
fi
echo -n "Warning: stalled $pidfile for $name"
echo -n Stopping $name \($pid\) ...
kill $pid
try=0
- while kill -0 $pid >/dev/null 2>&1; do
+ while ps p $pid >/dev/null 2>&1; do
sleep 1;
try=`expr $try + 1`
if [ $try = 20 ]; then
if [ -f "$pidfile" ]; then
pid=`cat "$pidfile"`
- if kill -0 $pid >/dev/null 2>&1; then
+ if ps p $pid >/dev/null 2>&1; then
echo "$name running as $pid"
else
echo "$name not running (stalled pidfile)"
local cmd="$3"
if [ -f "$pidfile" ]; then
- if kill -0 `cat $pidfile`; then
+ if ps p `cat $pidfile` >/dev/null 2>&1; then
return 0
fi
echo -n "Warning: stalled $pidfile for $name"
if [ -f "$pidfile" ]; then
pid=`cat "$pidfile"`
- if kill -0 $pid >/dev/null 2>&1; then
+ if ps p $pid >/dev/null 2>&1; then
echo "$name running as $pid"
else
echo "$name not running (stalled pidfile)"
local cmd="$3"
if [ -f "$pidfile" ]; then
- if kill -0 `cat $pidfile`; then
+ if ps p `cat $pidfile` >/dev/null 2>&2; then
return 0
fi
echo -n "Warning: stalled $pidfile for $name"
echo -n Stopping $name \($pid\) ...
kill $pid
try=0
- while kill -0 $pid >/dev/null 2>&1; do
+ while ps p $pid >/dev/null 2>&1; do
sleep 1;
try=`expr $try + 1`
if [ $try = 20 ]; then
if [ -f "$pidfile" ]; then
pid=`cat "$pidfile"`
- if kill -0 $pid >/dev/null 2>&1; then
+ if ps p $pid >/dev/null 2>&1; then
echo "$name running as $pid"
else
echo "$name not running (stalled pidfile)"