Uploaded image for project: 'LAMS Development'
  1. LAMS Development
  2. LDEV-2475

temp dir uses java default instead of specified temp dir

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.4, 2.3.4, 2.3.3
    • Fix Version/s: 2.4, 2.3.4
    • Component/s: None
    • Labels:
      None

      Description

      For enterprise environments, it is useful to be able to specify the directory used for temporary files, instead of using the java default as we do now

        Activity

        Hide
        lfoxton Luke Foxton added a comment -
        Done

        From now on temp dir used is the one specified in db - if it does not exist or the lams user cant access it, it falls back to the java default os temp dir

        The files in the temp dir are also deleted each time lams is restarted
        Show
        lfoxton Luke Foxton added a comment - Done From now on temp dir used is the one specified in db - if it does not exist or the lams user cant access it, it falls back to the java default os temp dir The files in the temp dir are also deleted each time lams is restarted
        Hide
        ernieg Ernie Ghiglione added a comment -
        Ok, two big issues with this fix...

        1) If I changed the temp directory and save, the files are still being put in the old directory (for some reason the cache? doesn't get updated)

        2) We cannot delete *all* files in the temporary directory, only the ones that are created by LAMS. This can be *really* dangerous otherwise. For instance, I changed the temp dir to be /tmp but when I restarted LAMS *all* files within this directory where wiped out (regardless if they were LAMS files or not). So my suggestion is to only delete the files that lams creates, which are the ones that start with lams_* anyway..
        Show
        ernieg Ernie Ghiglione added a comment - Ok, two big issues with this fix... 1) If I changed the temp directory and save, the files are still being put in the old directory (for some reason the cache? doesn't get updated) 2) We cannot delete *all* files in the temporary directory, only the ones that are created by LAMS. This can be *really* dangerous otherwise. For instance, I changed the temp dir to be /tmp but when I restarted LAMS *all* files within this directory where wiped out (regardless if they were LAMS files or not). So my suggestion is to only delete the files that lams creates, which are the ones that start with lams_* anyway..
        Hide
        ernieg Ernie Ghiglione added a comment -
        actually, they start with lams* not lams_* (ie: lamstmp_* and lamszip_*
        Show
        ernieg Ernie Ghiglione added a comment - actually, they start with lams* not lams_* (ie: lamstmp_* and lamszip_*
        Hide
        lfoxton Luke Foxton added a comment -
        - Only files with "lams" prefix deleted on startup
        - Instead of temp dir being a startup constant, it is a fetched via a method in FileUtil that:

            - Creates the directory if writable and exists
            - Returns the specified temp if its writeable
            - Otherwise returns the java temp

        Affects lams_contentrepository, lams_central, lams_common and lams_learning, so recommend retest of areas that access the temp dir
        Show
        lfoxton Luke Foxton added a comment - - Only files with "lams" prefix deleted on startup - Instead of temp dir being a startup constant, it is a fetched via a method in FileUtil that:     - Creates the directory if writable and exists     - Returns the specified temp if its writeable     - Otherwise returns the java temp Affects lams_contentrepository, lams_central, lams_common and lams_learning, so recommend retest of areas that access the temp dir
        Hide
        ernieg Ernie Ghiglione added a comment -
        Tested and closed for 2.3.4 and 2.4
        Show
        ernieg Ernie Ghiglione added a comment - Tested and closed for 2.3.4 and 2.4

          People

          • Assignee:
            lfoxton Luke Foxton
            Reporter:
            lfoxton Luke Foxton
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development