xwiki-contrib/xinit — pull request #8 by rebelthor (2013-11-18 08:21:55+00:00)
Title: Fixes a bug where multiple java processes and a missing catalina.pid fil...

...e causes a new process start loop.

TOMCAT_PID="`ps auxww | grep ${TOMCAT_PROCESS_NAME} | grep ${TOMCAT_HOME}| awk '{print $2}'`"
root@server:/var/lib/xinit# ps auxww | grep tomcat | grep /usr/local/tomcat | awk '{print $2}

'
6130
29853
30151

The old code then attempted to do a kill -9 on the above variable which failed, leading to no processes being killed, and in some cases, a start loop:

06-09-2013 17:30:50 [INFO]: Starting Tomcat Server ...
06-09-2013 17:30:50 [INFO]: Starting Tomcat Server ...
06-09-2013 17:30:50 [INFO]: Starting Tomcat Server ...
06-09-2013 17:30:50 [INFO]: Starting Tomcat Server ...
06-09-2013 17:30:50 [INFO]: Starting Tomcat Server ...
06-09-2013 17:30:50 [INFO]: Starting Tomcat Server ...