Skip to content
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

Adds child process reaping when Consul is running as PID 1. #1539

Merged
merged 4 commits into from
Dec 22, 2015
Merged

Conversation

slackpad
Copy link
Contributor

Used the same testing methodology as hashicorp/consul-template#479 to make sure this is working (it seems extremely hard to unit test beyond verifying config.

This should fix #1183.

The config behavior is slightly different than CT since Consul can't tell whether the user set an item or not. I looked into adding that but it looked like a big effort, and out of scope for this. This should be zero-config for nearly all use cases, anyway.

@slackpad
Copy link
Contributor Author

/cc @ryanuber or @sethvargo for review

if !config.DisableReap && (os.Getpid() == 1) {
logger := c.agent.logger
if !reap.IsSupported() {
logger.Printf("[WARN] Running as PID 1 but child process reaping is not supported on this platform, disabling")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

80-char

slackpad added a commit that referenced this pull request Dec 22, 2015
Adds child process reaping when Consul is running as PID 1.
@slackpad slackpad merged commit 14922b5 into master Dec 22, 2015
@slackpad slackpad deleted the f-reap branch December 22, 2015 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider making Consul act as a viable "pid 1" in containers
2 participants