On Fri, Jul 8, 2011 at 1:03 PM, Quanah Gibson-Mount <quanah@zimbra.com> wrote:
We work to make the various portions of our product use
/opt/zimbra/data/tmp for tempfiles.  However (as noted in the recent thread
about KVM issues), I've found that when jython is instantiated, it is not
using that path, but is instead using /tmp.

I've tried various ways (with no success) to change this behavior:

a) In our jython software
import tempdir
tempfile.tempdir="/opt/zimbra/data/tmp"


(Which changes it *after* instantiation, good, but not everything I'm
looking for)

b) While invoking jython:

exec `dirname $0`/zmjava -Djava.io.tmpdir=/opt/zimbra/data/tmp
-Dpython.cachedir=/opt/zimbra/data/tmp/jython-cachedir
org.python.util.jython "$@"

How can I get jython to use the correct tempdir at invocation, so I can
avoid the issue where people mount /tmp noexec?

--Quanah

Not sure if this is portable to non-*ix:
 
$ TMPDIR=/tmp/blee /usr/local/jython-2.5.2/bin/jython
Jython 2.5.2 (Release_2_5_2:7206, Mar 2 2011, 23:12:06)
[OpenJDK Server VM (Sun Microsystems Inc.)] on java1.6.0_20
Type "help", "copyright", "credits" or "license" for more information.
>>> import tempfile
>>> file_ = tempfile.NamedTemporaryFile()
>>> file_.name
'/tmp/blee/tmpqwL9cQ'
>>>

HTH