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()
I've used the following script with great success on numerous servers:
pid=`jps -v | grep $INSTALLATION | awk '{print $1}'`
echo $INSTALLATION found at PID $pid
while [ -e /proc/$pid ]; do sleep 0.1; done
notes:
$INSTALLATION
contains enough of the process path that's it's totally unambiguousThis script is actually used to shut down a running instance of tomcat, which I want to shut down (and wait for) at the command line, so launching it as a child process simply isn't an option for me.