shieldproject / shield-boshrelease

BOSH Release for shield
MIT License
11 stars 17 forks source link

change all the /tmp references into TMPDIR #40

Closed karampok closed 8 years ago

karampok commented 8 years ago

A job trying to write into the /tmp folder is not good practise.

karampok commented 8 years ago

if I am not mistaken, the correct value for the TMPDIR is always set up by the help scripts https://github.com/starkandwayne/shield-boshrelease/blob/master/jobs/shield-agent/templates/helpers/ctl_setup.sh#L56 and is the /var/vcap/sys/tmp/shield-agent/.

Also the TMPDIR should have a proper default value by the os (which is /tmp in linux), but I am not sure about that.

jhunt commented 8 years ago

Does it hurt to be sure and set it?

i.e.:

TMPDIR=${TMPDIR:-/tmp}
karampok commented 8 years ago

If the tmp folder is not writable by the user that runs the script, then it might create an issue. We had this issue with our setup. Nevertheless, the bosh-release takes care to use the proper TMPDIR.

I updated the pull request with this addition.