Skip to content

[BUG] flock doesn't work with NFS #1979

@NorseGaud

Description

@NorseGaud

Bug Report

Context

Several scripts use flock to lock various files and "prevent race conditions
Screen Shot 2021-05-17 at 9 34 53 PM

https://linux.die.net/man/2/flock
Notes
flock() does not lock files over NFS. Use fcntl(2) instead: that does work over NFS, given a sufficiently recent version of Linux and a server which supports locking.

What is affected by this bug?

Ability to use NFS (and EFS)

When does this occur?

./setup.sh commands that use the binaries that use flock

How do we replicate the issue?

Mount NFS4.1 and use it to store the configs.

Behavior

+ docker run --rm -v /mnt/efs-us-west-2/config:/tmp/docker-mailserver -ti {tag} delmailuser {email}
Do you want to delete the mailbox as well (removing all mails) ? [Y/n] y
flock: 200: Bad file descriptor

FSTAB:
XXX:/ /mnt/efs-us-west-2 nfs4 nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport 0 0

Metadata

Metadata

Assignees

No one assigned

    Labels

    meta/needs triageThis issue / PR needs checks and verification from maintainersmeta/staleThis issue / PR has become stale and will be closed if there is no further activitypriority/medium

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions