I have a python script that\'ll be checking a queue and performing an action on each item:
# checkqueue.py while True: check_queue() do_something()
if ! test -f $PIDFILE || ! psgrep `cat $PIDFILE`; then restart_process # Write PIDFILE echo $! >$PIDFILE fi