-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should support -x as a no-op like util-linux does #9
Comments
Some background here - http://stackoverflow.com/a/31445288/255961 |
I would gladly consider a PR, or at least some draft documentation (or a unit test) for the feature |
ah, per https://github.com/karelzak/util-linux/blob/master/sys-utils/flock.1#L81 how about:
It looks like this has already been implemented in #8, but hasn't been adequately documented (along with other things added by the patch). |
Workaround: flock_ex()
{
set +e
man flock | grep -q "\-x"
NON_LINUX_FLOCK=$?
set -e
if [ "$NON_LINUX_FLOCK" = 1 ]; then
flock /tmp/docker-up.lock $@
else
flock -x /tmp/docker-up.lock -c "$@"
fi
}
flock_ex docker-compose -p "$PREFIX" -f "$DIR/$RUN_ENV.yml" ps |
The current 0.2.3 version of flock (last one from the tag) does not contains this patch, thus the homebrew version don't work with Would it be possible for you to carve out a new release from the current master? |
For info, I have added the current master commit of flock in my personal homebrew tap. I am open to contributing an update to your homebrew tap if a new release is carved out of the current master 🙂 (I can also help making it an addition to the official Homebrew core formula if you wish so). |
@Mayeu ok, what do we need to do to release?
Anything else we'd need to check? Can you confirm you have permissions to make those changes? Does anyone else want permissions? |
flock is not native on mac os. There is a package that can be installed, https://github.com/discoteq/flock, but it does not support the -x option. See discoteq/flock#9 By default, flock is exclusive so there's no need for the -x in the first place Tested: Verified no error with flock when running script on mac os Change-Id: Iab6bdb2a378cace290ad61569ae40c86baebc264 Signed-off-by: Andrew Geissler <[email protected]>
No description provided.
The text was updated successfully, but these errors were encountered: