-
-
Notifications
You must be signed in to change notification settings - Fork 244
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
Delay return of control during startup #127
Conversation
Should this really be part of the init script and not the chef setup process? |
@tgwizard See hashicorp/consul#677 ; the issue occurs when called outside of chef. It just so happens that |
@jhmartin ah, ok. Still, this will affect starts and stops when not running through knife ssh etc., slowing everything down. Wouldn't
work for you? |
@tgwizard I suppose it would, but that means other users also have to know about this behavior and think about each invocation mechanism (Rundeck, mcollective, ssh-for-loop, fabric, ansible, etc) and determine if it requires a timing-safe wrapper. Startup scripts do not normally have that kind of environmental sensitivity, so having consul allow it violates Least Surprise. |
I think this needs to be in the init script. You can trigger this bug simply by writing a recipe that does Might I suggest checking
[do you mind adding this patch ^^^ for |
further testing and it seems like we can't rely on |
I am not a huge fan of this. Is it really what the Consul folks suggest? |
Is there an alternate fix for this? afaik, hashicorp currently recommends adding sleep to startup command: hashicorp/consul#677 (comment) |
If we add it, perhaps it should be customizable? Not everyone will have the use-case of starting consul over ssh like this. |
I am willing to put these changes in if someone wants to submit a PR. I'm going to have one more release prior to merging in #126. |
… shutdown when invoked via knife ssh (or any short-lived pty), fixes sous-chefs#125.
a11891d
to
b238d7c
Compare
I've updated this PR against current master and made the sleep configurable, but defaults to a safe value. The value can be set to 0 if the environment does not need the extra safety. @dpkp I'm not familar enough w/upstart -- you can submit a PR against my branch though and I'll include it, or you can submit a separate PR. |
Delay return of control during startup
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Give consul time to install its HUP signal handler to avoid immediate shutdown when invoked via knife ssh, fixes #125.