when stopping a service with /usr/local/bin/tomcat, java_stop waits 15 seconds for the service to shut down, and then gives up.
mulgara often takes longer than 15 seconds to shut down.
if, in the course of a backup, mulgara is restarted before it has completely shut down, hilarity ensues.
i'm going to suggest that we wait 60 seconds, and then kill the process if it's still not down at that point.
please comment if you think this is a bad idea. we need *some* reliable way to stop and start the services in order to run backups. please commit to rc7 if you think it's okay.
here's my updated java_stop routine:
java_stop() {
$JAVA_HOME/bin/java $TOMCAT_OPTS $CATALINA_OPTS stop >>$STDLOG 2>&1
# Give it a few seconds to stop (to delete PID file)
# if it's not dead yet, kill it over and over again
PID=`cat ${PIDFILE} 2>/dev/null`
i=1
while [ -n "$PID" ] ; do
PID=`ps -p $PID -o pid | tail -n +2`
sleep 1
i=$((i+1))
if [ $i -gt 60 ]; then
echo "murder death kill"
kill $PID
fi
done
[ -z "$PID" ] && rm -f $PIDFILE
}