Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • S slapos.recipe.cmmi
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 3
    • Merge requests 3
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • nexedinexedi
  • slapos.recipe.cmmi
  • Merge requests
  • !8

Do not set any TMP environment variables

  • Review changes

  • Download
  • Patches
  • Plain diff
Merged Jérome Perrin requested to merge fix/tmpdir-golang into master Oct 04, 2018
  • Overview 9
  • Commits 2
  • Pipelines 2
  • Changes 2

This reverts daa833ea ( https://lab.nexedi.com/nexedi/slapos.recipe.cmmi/merge_requests/3 ) and extend it to not set $TMP either.

De facto, setting only $TMP was never effective ( see also #20120530-132221B ) and as we saw in https://lab.nexedi.com/nexedi/slapos.recipe.cmmi/merge_requests/3#note_67059 it causes more harm than good.

The conclusion so far is that environment variables related to temporary files should be handled by the parent process. The parent process is responsible for providing a directory short enough so that we can create unix sockets in $TMPDIR and to clean up this directory afterwards.

In a pure buildout it could be:

tmpdir=$(mktemp -d)
trap 'rm -rf $tmpdir' SIGINT SIGTERM
TEMP=$tmpdir TMPDIR=$tmpdir TMP=$tmpdir buildout
rm -rf $tmpdir
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: fix/tmpdir-golang
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7