-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
consul lock option to return child process exit code #947
Comments
I think a |
+1 This would be very useful to serialize some checks we run, but I need the return code to confirm the check result. |
Any chance this will be merged in? |
@dpkirchner there's one outstanding thing with the PR and it needs a rebase. I'll try to get this in before the next release - it's super close. |
Looking forward to not having to use this workaround :) |
+1 would love to have this in :) @slackpad bump :) |
Would be very useful have this feature in the next release :) |
I found a slightly nicer (yet still ugly) workaround by the way, but I'd also prefer not having to use it :)
Using this one it's also possible to differentiate between failure of lock acquisition (exit code 1) and failure of the child process (exit code 2). |
I just wrote a very wrong script because I assumed that |
yup, made that mistake as well. by the way my hack does not work anymore with >0.8 |
I've got a script, call it
foo.sh
, that I want to wrap in a lock and then check the exit code for errors:Currently this will check the exit code of consul, not foo.sh. It would be useful to have an option to make consul set its exit code equal to the exit code of the child process.
The workaround for now is to have the child process write its exit code to a a file:
Which seems a bit messy to me, but perhaps I just need more bash zen.
The text was updated successfully, but these errors were encountered: