1

I've RHEL server where security team keeps on applying security patches every month and then reboot the server. I've apache tomcat installed on RHEL server and a web application (HTML/CSS/Javascript front end and Spring boot backend) running (WAR deployed). After every security patching, I notice 503 Service Unavailable on my web browser and I have to manually start the apache tomcat server (sudo bin/startup.sh) everytime. Is there a way this can be configured in RHEL server so that I don't have to manually start the server everytime after patching is done?

Spring boot has it's own embedded tomcat server which I am not using in this case since I am deploying my app as a WAR in the tomcat server installed on RHEL server.

John
  • 145
  • 8
  • can you post any of the logs showing if the service is trying to start and failing at boot? – SteamerJ Dec 19 '18 at 14:42
  • Let me see. It's going to be in `catalina.out` file of tomcat server, right? OR are you referring to something related to RHEL trying to start these services? Thanks – John Dec 19 '18 at 14:46
  • catalina.out would be the first place to start. Have you checked the service status to see if it tried to start at boot? `service tomcat6 status` or `service tomcat7 status` depending on your version of tomcat. – SteamerJ Dec 19 '18 at 14:49
  • I just tried doing `service tomcat8 status` and got the message` Redirecting to /bin/systemctl status tomcat8.service` ` Unit tomcat8.service could not be found.` – John Dec 19 '18 at 14:55
  • are you using tomcat8 or a different version? You can see my answer below as the first command dumps out all the registered services and if they're set to startup with the system or not – SteamerJ Dec 19 '18 at 14:57
  • I am using `Server version: Apache Tomcat/8.0.33 ` – John Dec 19 '18 at 15:00
  • Is that listed in your services when you dump them all out `systemctl list-unit-files --type service` The name of the service might not be tomcat8 and that will help you see if there is even a tomcat service registered – SteamerJ Dec 19 '18 at 15:02
  • Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/87283/discussion-between-steamerj-and-john). – SteamerJ Dec 19 '18 at 15:04

1 Answers1

0

https://platform.igrafx.com/doc/installation-guide/install-application-server-environments-for-development-and-testing/installation-tomcat-8-on-centos-7-or-rhel-red-hat-enterprise-linux-7

It appears that there is not any service registered that is related to tomcat, which points to it likely being installed from source. You'll need to create a service script, register the script, test if starting/stopping works and then enable it to start at boot. The link above should give the information needed to perform all of these actions. Just make sure it's during an acceptable maintenance window and the current running process for tomcat is shut down.

SteamerJ
  • 403
  • 2
  • 7
  • I just ran the above command and I have only 7 things starting with letter `t`. Please see this image screenshot (https://i.stack.imgur.com/n11gw.png). I don't see anything starting with tomcat there. Is it the `target.service` you are referring to? Thanks – John Dec 19 '18 at 15:04
  • @yoonix I changed my answer based on a chat discussion we had. His comment was in reply to the old answer – SteamerJ Dec 19 '18 at 20:53