Details
-
New Feature
-
Status: Closed
-
TBD
-
Resolution: Fixed
-
None
-
None
-
None
-
Medium
Description
As opposed to only using environment variables, user home directories, or current working directories.
Pro:
- Some containers (e.g., Tomcat) allow context descriptors to be passed as a separate file
http://fnords.wordpress.com/2010/07/29/how-to-package-your-tomcat-webapp/#comment-1264
including, to my understanding, setting properties
http://tomcat.apache.org/tomcat-6.0-doc/config/context.html
In some situations, e.g., Debian packaging, we are not allowed to simply arbitrarily change the owner of /usr/share/tomcat6 as is done here:
http://svn.openmrs.org/openmrs-contrib/install/packagemanagers/deb/DEBIAN/postinst
The trunk patch was tested on jetty container using both the added section in web.xml commented out (in which default
behavior ensues, at least on my system - in any case null is passed by getInitParameter), and with the section un-commented (in which the /tmp/ folder becomes used as shown by console output from mvn jetty:run
WARN - OpenmrsUtil.getRuntimeProperties(2459) |2010-10-03 21:41:05,474| Unable to find properties file: /tmp/openmrs-runtime.properties
WARN - OpenmrsUtil.getRuntimeProperties(2473) |2010-10-03 21:41:05,477| Also unable to find a runtime properties file at /home/misha/workspace/trunk/webapp/openmrs-runtime.properties
WARN - OpenmrsUtil.getRuntimeProperties(2495) |2010-10-03 21:41:05,478| Unable to find a runtime properties file. Initial setup is needed. View the webapp to run the setup wizard.
patch-1.6.x.patch (for http://svn.openmrs.org/openmrs/branches/1.6.x) was tested as applied to a particular version (1.6.1) with the web.xml commented out and the following file placed in /etc/tomcat6/Catalina/localhost/openmrs.xml :
<Context path="/openmrs"
docBase="/tmp/openmrs.war">
<!--
<Parameter name="application.data.directory" value="/tmp"
override="false"/>
-->
</Context>
with the section commented and uncommented, the difference is picked up correctly in the openmrs setup wizard.
patch-1.7.x.patch (for http://svn.openmrs.org/openmrs/branches/1.7.x) is currently untested , but due to similarity to the other two is expected to work similarly.
Thank you
Misha