History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: LDEV-2475
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Luke Foxton
Reporter: Luke Foxton
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
LAMS Development

temp dir uses java default instead of specified temp dir

Created: 08/Dec/09 04:48 PM   Updated: 11/Feb/10 03:04 PM
Component/s: None
Affects Version/s: 2.4, 2.3.3, 2.3.4
Fix Version/s: 2.4, 2.3.4

Resolution Date: 11/Feb/10 11:35 AM
Date of First Response: 10/Feb/10 04:02 PM


 Description  « Hide
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

 All   Comments   Change History   FishEye      Sort Order:
MAIN:lfoxton:20091209010257 by  Luke Foxton (3 files) 08/Dec/09 07:02 PM
LDEV-2475 Changing the implementation to use the temp dir specified in the config table instead of the java default. This means that the temp dir has to be cleaned for every restart of the lams server
lams_central/src/java/org/lamsfoundation/lams/web/LamsStartupServlet.java 1.1 (+88) new
lams_central/web/WEB-INF/web.xml 1.47 (+11 -0) diffs
lams_common/src/java/org/lamsfoundation/lams/util/FileUtil.java 1.35 (+1 -1) diffs

MAIN:lfoxton:20091209013004 by  Luke Foxton (2 files) 08/Dec/09 07:30 PM
LDEV-2475 As per jun-dir's request, added a fallback for java default temp dir if the temp dir in the database doesnt exist or is forbidden
lams_central/src/java/org/lamsfoundation/lams/web/LamsStartupServlet.java 1.2 (+22 -16) diffs
lams_common/src/java/org/lamsfoundation/lams/util/FileUtil.java 1.36 (+124 -82) diffs

Luke Foxton - 09/Dec/09 12:55 PM
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

Change by Luke Foxton - 09/Dec/09 12:55 PM
Field Original Value New Value
Status Open [ 1 ] Resolved [ 5 ]
Fix Version/s 2.3.3 [ 10141 ]
Resolution Fixed [ 1 ]

MAIN:jliew:20091214020918 by  jliew (1 file) 13/Dec/09 08:09 PM
Ernie Ghiglione - 10/Feb/10 04:02 PM
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..

Change by Ernie Ghiglione - 10/Feb/10 04:02 PM
Resolution Fixed [ 1 ]
Status Resolved [ 5 ] Reopened [ 4 ]

Ernie Ghiglione - 10/Feb/10 04:20 PM
actually, they start with lams* not lams_* (ie: lamstmp_* and lamszip_*

Luke Foxton - 11/Feb/10 11:35 AM
- 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

Change by Luke Foxton - 11/Feb/10 11:35 AM
Status Reopened [ 4 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]

Ernie Ghiglione - 11/Feb/10 03:04 PM
Tested and closed for 2.3.4 and 2.4

Change by Ernie Ghiglione - 11/Feb/10 03:04 PM
Status Resolved [ 5 ] Closed [ 6 ]