[Labs-l] Tools: Issues with temporary files and the Peachy framework

Tim Landscheidt tim at tim-landscheidt.de
Wed Jul 9 17:26:37 UTC 2014


Hi,

today I fixed up tools-exec-cyberbot.  Its root partition
had run out of inodes because /tmp was infested by about
400000 temporary cookie files.

Per default, SGE sets the environment variable TMPDIR to a
directory beneath /tmp that is dedicated to the submitted
job and removed afterwards.  This means that programs that
don't clean up the temporary directory after themselves
don't leave waste behind.

Merlissimo pointed out however that the Peachy framework
contains an error that makes it save cookie files not as
${TMPDIR}/file, but as ${TMPDIR}file, i. e. the file is
created directly in /tmp and thus not removed by SGE when
the job terminates.  This caused the clogging on
tools-exec-cyberbot.

Fixing this in Peachy is easy: Change
https://code.google.com/p/mw-peachy/source/browse/trunk/Includes/Wiki.php#273
from:

|                         $this->http->setCookieJar( tempdir() . 'PeachyCookieSite' . sha1( $configuration['encodedparams'] ) );

to:

|                         $this->http->setCookieJar( tempdir() . '/PeachyCookieSite' . sha1( $configuration['encodedparams'] ) );

But a) Peachy hasn't seen (public) development since 2010,
and b) developers of tools that use Peachy would need to up-
date their installation at Tools anyhow.

So if you use Peachy, please incorporate the fix above in
your local installation.  If you have access to the public
repository, please commit the fix there as well.

Thanks again to Merlissimo for his advice.

Tim




More information about the Labs-l mailing list