www/tomcat7 bug in rc.d startup script when clear_tmp_enable="YES"

Devin Teske devin.teske at fisglobal.com
Tue Sep 6 19:29:48 UTC 2011


Hi List,

A bit short on time here and can't file a PR just this minute, but wanted to
share a buggette that we've discovered in the www/tomcat7 port (currently at
version 7.0.20 as of last week, but bug dates back months as far back as version
7.0.14 and perhaps further).

___ Bug description: ___

If one puts the following two lines into one's rc.conf(5) configuration:

	tomcat7_enable="YES"
	clear_tmp_enable="YES"

What happens is that tomcat7 is fired up and creates his

	/tmp/hsperfdata_{user}

directory, but then later the clear_tmp script is fired and blows away items
recently created by tomcat.

The end-result is that after booting the system, one can execute:

	service tomcat7 status

and get the false response:

	tomcat7 is not running

Meanwhile, one can execute:

	ps auxwww | sh -c 'head -1; grep java'

and clearly see that tomcat *is* running. Indeed, one can even execute:

	cat /var/run/tomcat7.pid

and indeed, this is the correct pid.

___ Root-cause description: ___

The problem is truly that the tomcat7 rc.d script uses the jps command to
determine that the appropriate java process is running and that jps relies on
data in the java.io.tmpdir directory (/tmp) which was.... (wait for it) ...
whacked by clear_tmp moments after firing up tomcat.

___ Solution description: ___

Apply the following patch to /usr/local/etc/rc.d/tomcat7:

========== BEGIN PATCH EXCERPT ==========
--- /usr/local/etc/rc.d/tomcat7.orig    2011-09-06 12:25:45.000000000 -0700
+++ /usr/local/etc/rc.d/tomcat7 2011-09-06 12:26:17.000000000 -0700
@@ -4,7 +4,7 @@
 #

 # PROVIDE: tomcat7
-# REQUIRE: NETWORKING SERVERS
+# REQUIRE: NETWORKING SERVERS clear_tmp
 # BEFORE: DAEMON
 # KEYWORD: shutdown
 
========== END PATCH EXCERPT ==========
-- 
Devin

_____________

The information contained in this message is proprietary and/or confidential. If you are not the intended recipient, please: (i) delete the message and all copies; (ii) do not disclose, distribute or use the message in any manner; and (iii) notify the sender immediately. In addition, please be aware that any message addressed to our domain is subject to archiving and review by persons other than the intended recipient. Thank you.
_____________


More information about the freebsd-rc mailing list