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

Return not containerized if /proc/1/cgroup does not exist #42

Merged
merged 1 commit into from
Mar 19, 2019

Conversation

cwurm
Copy link

@cwurm cwurm commented Mar 18, 2019

We check the contents of /proc/1/cgroup to determine if we are in a container or not. However, this pseudo file will not exist if cgroup is not available, e.g. if it has been explicitly disabled, maybe on a shared system. This PR returns false (i.e. not containerized) if the file does not exist.

This has been reported on SO, and we fixed a similar issue in Beats (elastic/beats#3666).

@cwurm cwurm added the review label Mar 18, 2019
@cwurm cwurm requested a review from andrewkroh March 18, 2019 12:39
Copy link
Contributor

@ruflin ruflin left a comment

Choose a reason for hiding this comment

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

LGTM. Worth a changelog entry?

@cwurm
Copy link
Author

cwurm commented Mar 18, 2019

Worth a changelog entry?

If we had a changelog in this project, yes.

@ruflin
Copy link
Contributor

ruflin commented Mar 18, 2019

🤦‍♂️ Good time to start one?

@cwurm
Copy link
Author

cwurm commented Mar 18, 2019

Good time to start one?

Maybe. @andrewkroh what do you think?

@andrewkroh
Copy link
Member

Yeah, let's start one.

@cwurm
Copy link
Author

cwurm commented Mar 19, 2019

Ok, let's add it separate from this PR though. I think we'd want to define the format and contents. It's a bit tricky since this project has no releases, which would usually give structure to the changelog as dated sections.

@cwurm cwurm merged commit cbe2017 into elastic:master Mar 19, 2019
@cwurm cwurm deleted the linux_no_cgroup branch March 19, 2019 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants