Uploaded image for project: 'OpenMRS Core'
  1. OpenMRS Core
  2. TRUNK-1779

OpenMRS should allow application data directory (and thus location of openmrs-runtime.properties) to be specified in a Servlet API compatible manner

    XMLWordPrintable

    Details

    • Complexity:
      Medium

      Description

      As opposed to only using environment variables, user home directories, or current working directories.

      Pro:

      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

        Gliffy Diagrams

          Attachments

          1. patch-trunk.patch
            2 kB
          2. patch-1.7.x.patch
            2 kB
          3. patch-1.6.x.patch
            2 kB
          4. 1779-trunk-4.patch
            4 kB
          5. 1779-trunk-3.patch
            3 kB
          6. 1779-trunk-2.patch
            3 kB
          7. 1779-post-review-fix-comments.patch
            2 kB
          8. 1779-1.7.x-4.patch
            3 kB
          9. 1779-1.7.x-3.patch
            2 kB
          10. 1779-1.7.x-2.patch
            2 kB
          11. 1779-1.6.x-4.patch
            3 kB
          12. 1779-1.6.x-3.patch
            2 kB
          13. 1779-1.6.x-2.patch
            2 kB

            Activity

              People

              Assignee:
              misha680 Misha Koshelev [X] (Inactive)
              Reporter:
              misha680 Misha Koshelev [X] (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: