tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 57801] Tomcat catalina.sh fails to start after machine is reboot because there is another process have the same PID as Tomcat before reboot
Date Fri, 10 Apr 2015 11:23:13 GMT
https://bz.apache.org/bugzilla/show_bug.cgi?id=57801

--- Comment #5 from Rainer Jung <rainer.jung@kippdata.de> ---
(In reply to jiaoyk from comment #4)
> Thanks Rainer.
> 
> If the machine is shutdown by power off, the rc script may don't have chance
> to execute.

OK, but that's a really exceptional case. Then you might have the same problem
with lots of unix daemons. Either they ignore the PID file, or they don't
start.

> After use ps to check if the PID is alive, could you also extract the path
> of the process, and compare it with the home path of tomcat? If the path is
> the same, the process should be tomcat, otherwise, it's other process. Then,
> the script could rm the PID file and continue to start.

I doubt, that this is possible in a platform independent but maintainable way.
The script is used on lots of platforms, like various Linuxes, BSD, Solaris,
Cygwin, OS-X, and probably AIX, HP-UX, etc. etc.

Some of these platforms do not provide the full process command using "ps" but
they truncate it. IMHO there is no platform independent way to retrieve all
process args, e.g. the -Dcatalina.base=... that the script sets. I don't plan
to invest more into this, because it happens very rarely and the solution will
be fragile. Automatic problem resolution needs to be robust, otherwise it
triggers more problems than it solves.

If anyone likes to tackle this, patches will be welcome, but must be
multi-platform.

> Sometimes, the tomcat process is just hung up. could you provide a force
> start option? Even the tomcat process is there, just kill it and start
> anyway.

We could support the existing"-force" for "start" as well and let -force ignore
any PID file problems. An existing other process is only one such problem.
There are more cases where the script currently aborts. Do you think all these
cases should be ignored with -force? Please have a look at "abort" in
bin/catalina.sh.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message