Make the temporary directory path contain uid of the process #443
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This patch resolves #376 a problem with multi-user environment.
On many traditional *nix systems all the users on the same machine share a single global
/tmp
.If two users on such a system run spring at the same time, the first user's spring process
creates
/tmp/spring
and stores a pidfile and a socket within the directory.The second users process will then try to store its pidfile within
/tmp/spring
, but it failssince the directory is owned by another user and (usually) not writable to non-owners.
This patch resolves this problem by making the temporary directory path used by spring
contain the UID of the running process.
If you are the user with UID of 1000, your spring processes will create the directory
$TMPDIR/spring-1000
and store everything therein.Two other solutions are suggested on the issue #376
tmp
directory inside the Rails application's tree/tmp/spring
world-writableI think both of them have some problem
tmp
may reside within a filesystem without domain socket support./tmp/spring
is not safe --- Let other users delete your socket.AFAIK, Emacs and tmux takes this solution with process's UID to store per-user server socket in the global
/tmp
directory.