The restart.sh script does not start the Tomcat web server service properly
search cancel

The restart.sh script does not start the Tomcat web server service properly

book

Article ID: 216926

calendar_today

Updated On:

Products

CA Spectrum

Issue/Introduction

The restart.sh script from /tomcat/webapps/spectrum/ is used to stop and restart the tomcat web server service. 

However on certain environments, when running this script, the process is started, but then it does not work properly, and causing the web server to be not accessible. 

It looks like the start command is too fast after the stop command.
In some situations when tomcat can be very busy, the stop tomcat service command will take some time to stop it, and when the start command is issued before it got fully stopped, then the restart functionality may not function properly.

 

Environment

Release : 20.2

Component : Spectrum OneClick

Cause

This is depending on the environment and how busy the tomcat was when we are giving the command to stop with the restart.sh script. If it's doing some good amount of work then the tomcat stop may slightly get delayed and the script may be asking it to start again even if it is not stopped completely.

Resolution

This can be solved by adjusting the restart.sh script adding some delay between stop and start commands.

For example edit the script and add a sleep time:
 
"$TOMCAT_ROOT/bin/stopTomcat.sh"
sleep 10
"$TOMCAT_ROOT/bin/startTomcat.sh"


The sleep time may vary depending on the environment.