Score:0

restarting tomcat service monit

cn flag
RD7

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?

cn flag
Could you attach the full log or at least 20-30 more lines before `Stopping service Catalina`?
RD7 avatar
cn flag
RD7
why is it relevant?
cn flag
To solve the root cause.
Score:0
in flag

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.

RD7 avatar
cn flag
RD7
monit can't do 'service service-name restart'?
asktyagi avatar
in flag
please check https://stackoverflow.com/questions/20713187/monit-restart-service-how-do-i-know-when-its-done-restarting if that help.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.