fix bind mount bug when using proxy #149
Open
+94
−5
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.
When a proxy is used to provide access to CernVM-FS on a compute node, we add the proxy configuration to
/etc/cvmfs/default.local. The current code checked if this directory was already listed in the$BIND_PATHS, and exited if so.However, exiting is too strict. We only should exit if the source of the existing bind mount with destination
/etc/cvmfs/default.localis different to the currently changed source (where we're adding the proxy settings). If the sources are the same (we verify viareadlink -f), we don't need to add the bind mount to$BIND_PATHSagain (all is fine).This PR adds the function
check_bind_paths_for_targetthat checks whether a givensrc:targetbind mount is already in$BIND_PATHS. This function is then used to decide whether the given bind mount has to be added or not OR if an ambiguous situation has occurred (different sources for same target) and thuseessi_container.shshall terminate immediately.Code was tested in trz42/software-layer#93 via https://github.com/trz42/software-layer-scripts/tree/debug_bind_mount_issue