When you use the ‘alfresco.sh stop’ or ‘alfresco.sh stop tomcat’ command, the tomcat/scripts/ctl.sh script is called to shut down the Tomcat process. The ‘stop_tomcat()’ subroutine in this script, in turn, calls the Tomcat shutdown.sh script and passes in two arguments (‘300’ and ‘-force’) in the following section of the script:
if [ $RUNNING -eq 0 ]; then
echo "$0 $ARG: $TOMCAT_STATUS"
if [ $TOMCAT_ASTOMCATUSER -eq 1 ]; then
$TOMCAT_BINDIR/shutdown.sh 300 -force
This instructs the Tomcat shutdown script to wait (or sleep) up to 300 seconds before using the ‘kill’ command to force kill the process if it is still running. If your Tomcat shutdown process is making its way into this section of script – for whatever reason, and you are not willing to wait up to 5 minutes for the process to be killed, you can reduce the ‘sleep’ argument (i.e., 300) in the tomcat/scripts/ctl.sh script to a more tolerable amount of time (e.g., 30 or 60 seconds). Although you may not want to do this in your production Alfresco installation, consider using this tip in your test/development installation if the Tomcat shutdown time becomes an issue for you.