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

Detect lxc #1754

Merged
merged 4 commits into from May 26, 2020
Merged

Detect lxc #1754

merged 4 commits into from May 26, 2020

Conversation

pvizeli
Copy link
Member

@pvizeli pvizeli commented May 26, 2020

No description provided.

supervisor/core.py Outdated Show resolved Hide resolved
pvizeli and others added 2 commits May 26, 2020 13:44
Co-authored-by: Franck Nijhof <git@frenck.dev>
@pvizeli pvizeli merged commit 960b00d into dev May 26, 2020
@delete-merged-branch delete-merged-branch bot deleted the detect-lxc branch May 26, 2020 12:12
@rkkoszewski
Copy link

Just for the sake of completeness. LXD is not LXC. LXD is a wrapper for LXC. Therefore this change will not detect if if Hass is running inside a LXC container but instead if it's running in a LXC container using the LXD wrapper (The usual on Ubuntu).

If the LXC container is running without LXD this will not detect anything (For example Debian does not provide a LXD package, and systems like Proxmox use their own wrapper that use LXC directly).

There is supposedly a way to detect LXC directly by querying the file "/proc/self/cgroup" and detecting if it's running in a container with cgroup. But as far as I understand, it is also possible to run LXC without cgroup enabled, so this is a tricky one to solve.

@Tollbringer
Copy link

Why is it important to detect LXC in the first place?

@rkkoszewski
Copy link

I guess in case people have issues and they upload the Logs, so it's visible, as it's a non supported way of installing hass. Also probably because people usually ask regarding some issue without even stating that it's running in a LXC container. LXC is not particularly easy to debug, especially for people with little experience with it. Failing to disclose that you're running Hass in an LXC can make you or whoever wants to help, run in circles debugging all kind of unobvious issues.

@Tollbringer
Copy link

That would be very valuable information for the devs to save their resources and wash their hands of the problem. 100% in support of this.

If it is used to cripple HA on other "implementations" of this amazing software, I would not support this purpose. Who knows- just offering my limited concerns.

@lock lock bot locked and limited conversation to collaborators Jun 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants