0

I have a Tomcat service running that fail sometimes - I did not find the reason yet. In the Catalina log I see the following:

Feb 03, 2022 10:54:39 AM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["http-bio-80"]
Feb 03, 2022 10:54:39 AM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["http-bio-443"]
Feb 03, 2022 10:54:39 AM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["ajp-bio-8009"]
Feb 03, 2022 10:54:39 AM org.apache.catalina.core.StandardService stopInternal
INFO: Stopping service Catalina

which gives no information about root cause.

When I try to see the service status:

$sudo -E service tomcatd status
tomcatd dead but pid file exists

I want to write simple monit script that will monitor this behaviour and restart tomcatd in case it happens, but I did not find any example to such a situation. Any idea?

Rhangaun
  • 179
  • 1
  • 15
RD7
  • 51
  • 1

1 Answers1

0

To fix this try below.

kill -9 pid
ps -eaf|grep pid
service service-name restart

Now for monit you have to write script to check the logs and pid and execute the desired action.

Some examples are below

Monitor a process using monit in ubuntu

monit: check process without pidfile

To know the root cause you have to either run in debug mode or if you already running check the logs what happen before process die or become non-functional.

asktyagi
  • 2,401
  • 1
  • 5
  • 19