火曜日, 1月 26, 2010

God - A Process Monitoring Framework in Ruby

God - A Process Monitoring Framework in Ruby

clean stale pids:
PID_DIR=/var/run/mongrel
RUBYBIN=/usr/bin/ruby

clean_stale_pid ()
{
for PIDFILE in ls $PID_DIR/*.pid; do
if [ -e $PIDFILE ]; then
PIDDIR=/proc/$(cat $PIDFILE)
if ! [ -d ${PIDDIR} -a "$(readlink -f ${PIDDIR}/exe)" = $RUBYBIN ]; then
#echo "removing stale pid: $PIDFILE"
rm -f $PIDFILE
fi
fi
done
}


See also:
Thin
Ebb

0 件のコメント: