Skip to content

Commit

Permalink
Detect more kinds of s3fs mount failures
Browse files Browse the repository at this point in the history
s3fs can claim to have a mount even though it didn't succeed.
Doing an operation actually forces it to detect that and remove the mount.
+ls "${AWS_S3_MOUNT}"
  • Loading branch information
totycro committed Sep 1, 2020
1 parent e7ef97a commit 012d136
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ su - $RUN_AS -c "s3fs $DEBUG_OPTS ${S3FS_ARGS} \
-o gid=$GID \
${AWS_S3_BUCKET} ${AWS_S3_MOUNT}"

# s3fs can claim to have a mount even though it didn't succeed.
# Doing an operation actually forces it to detect that and remove the mount.
ls "${AWS_S3_MOUNT}"

mounted=$(mount | grep fuse.s3fs | grep "${AWS_S3_MOUNT}")
if [ -n "${mounted}" ]; then
echo "Mounted bucket ${AWS_S3_BUCKET} onto ${AWS_S3_MOUNT}"
Expand Down

0 comments on commit 012d136

Please sign in to comment.