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
火曜日, 1月 26, 2010
God - A Process Monitoring Framework in Ruby
登録:
コメントの投稿 (Atom)
0 件のコメント:
コメントを投稿