#!/bin/sh
pid=`ps --user=nobody | grep memcached | awk '{print $1}'`
if kill -0 $pid 2> /dev/null ; then
exit 0
else
echo memcached process not found, restarting...
/usr/local/bin/memcached -u nobody -d -m 128 -l 127.0.0.3 -p 11211
sleep 2
pid=`ps --user=nobody | grep memcached | awk '{print $1}'`
if kill -0 $pid 2> /dev/null ; then
echo process $pid ok
fi
fi
exit 0
#!/bin/sh
pid=`ps --user=nobody | grep memcached | awk '{print $1}'`
if kill -0 $pid 2> /dev/null ; then
exit 0
else
echo memcached process not found, restarting...
/usr/local/bin/memcached -u nobody -d -m 128 -l 127.0.0.3 -p 11211
sleep 2
pid=`ps --user=nobody | grep memcached | awk '{print $1}'`
if kill -0 $pid 2> /dev/null ; then
echo process $pid ok
fi
fi
exit 0