2015-04-09 13:26 GMT+03:00 Rainer Jung <rainer.j...@kippdata.de>: > Am 09.04.2015 um 11:57 schrieb Konstantin Kolinko: >> >> 2015-04-09 12:24 GMT+03:00 <rj...@apache.org>: >>> >>> Author: rjung >>> Date: Thu Apr 9 09:24:49 2015 >>> New Revision: 1672272 >>> >>> URL: http://svn.apache.org/r1672272 >>> Log: >>> BZ57801: Give a hint on what to do. >>> >>> This might happen, if a system reboot happens, >>> Tomcat is not shut down properly and another >>> process reuses the PID after the reboot, before >>> Tomcat is being started. >>> >>> Modified: >>> tomcat/trunk/bin/catalina.sh >>> >>> Modified: tomcat/trunk/bin/catalina.sh >>> URL: >>> http://svn.apache.org/viewvc/tomcat/trunk/bin/catalina.sh?rev=1672272&r1=1672271&r2=1672272&view=diff >>> >>> ============================================================================== >>> --- tomcat/trunk/bin/catalina.sh (original) >>> +++ tomcat/trunk/bin/catalina.sh Thu Apr 9 09:24:49 2015 >>> @@ -342,6 +342,7 @@ elif [ "$1" = "start" ] ; then >>> ps -p $PID >/dev/null 2>&1 >>> if [ $? -eq 0 ] ; then >>> echo "Tomcat appears to still be running with PID $PID. >>> Start aborted." >>> + echo "If this process is not a Tomcat process, remove the >>> PID file and try again." >>> exit 1 >>> else >>> echo "Removing/clearing stale PID file." >> >> >> Maybe provide additional information? >> >> a) Information on the process? (ps .. ?) > > > Will do using "ps -f -p $PID" which seems to be standards compliant and at > least works on some Linux I tested, Solaris and FreeBSD. > > Example output: > > UID PID PPID C STIME TTY TIME CMD > jung 10743 1 0 10:59:23 pts/1 0:26 > /usr/local/jdk1.8.0/bin/java -Dapp.id=jmeter.bank-api -jar > /shared/build/dev/jm > > Solaris truncates the CMD field (like in this example), Linux and FreeBSD > seem to show the full one.
Looking into POSIX, option -o <formatname> seems to be more standard than -f http://pubs.opengroup.org/onlinepubs/9699919799/utilities/ps.html Though Solaris is known for not following POSIX in some of its utilities, and using "-f" gives a more customary (=more usual) format from user's point of view. Thank you for testing on different OSes. >> b) Path to the PID file. > > > Path the the PID file is printed further up when the script starts "Using > CATALINA_PID: ...". Ack. Though a caveat is that those "Using..." lines are only printed when starting interactively (guarded by "if [ $have_tty -eq 1 ];"). Best regards, Konstantin Kolinko --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org