Add documentation about JAVA_OPTS defined in /etc/init.d/tomcat6 not propagating to startup

Bug #706570 reported by Reuben Firmin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tomcat6 (Ubuntu)
Confirmed
Wishlist
Unassigned

Bug Description

Binary package hint: tomcat6

I have not fully investigated. However, I added the line:

JAVA_OPTS="$JAVA_OPTS -Xmx4096m -Xms1024m -XX:PermSize=256m -XX:MaxPermSize=512m -XX:NewSize=128m -Dri.home=/home/reubenf/code/depend"

to /etc/init.d/tomcat6. The ri.home variable was not available to my webapp after a tomcat restart.

I then added the same line to /var/share/tomcat6/bin/catalina.sh. Two things happened:

1) The server failed to start because I have only 4GBs of RAM, and thus max heap was too large. (Adjusted in catalina.sh and all was well.)

2) Once I fixed the max heap, ri.home was available to my webapp.

Thus for some reason JAVA_OPTs is not being passed between the scripts properly. You should also define a spot in /etc/init.d/tomcat6 for developers to add their own JAVA_OPTs, to minimize hackery.

Revision history for this message
Joshua Daniel Franklin (joshuadfranklin) wrote :

Reuben, it's not obvious in the init script but the proper place is /etc/default/tomcat6 which includes a JAVA_OPT line, which actually clobber the one in the init script due to the "if -z JAVA_OPT". This actually bit me recently due to a tomcat update.

Revision history for this message
Thierry Carrez (ttx) wrote :

Yes, like Joshua said, you shouldn't change the init script, but rather use /etc/default/tomcat6 to influence it.

Changed in tomcat6 (Ubuntu):
status: New → Invalid
Revision history for this message
Reuben Firmin (reubenf) wrote :

This needs to be documented in /etc/init.d/tomcat.

It's a non-standard location given that many developers will be used to working with the RHEL packages, or directly installing from the tarball.

Changed in tomcat6 (Ubuntu):
status: Invalid → New
Thierry Carrez (ttx)
Changed in tomcat6 (Ubuntu):
importance: Undecided → Wishlist
status: New → Confirmed
summary: - JAVA_OPTS defined in /etc/init.d/tomcat6 do not propagate to startup
+ Add documentation about JAVA_OPTS defined in /etc/init.d/tomcat6 not
+ propagating to startup
Revision history for this message
Reuben Firmin (reubenf) wrote :

Thanks.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.