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

Support Plug&Play Permission updates on CGroupv2 #3960

Open
agners opened this issue Oct 20, 2022 · 1 comment
Open

Support Plug&Play Permission updates on CGroupv2 #3960

agners opened this issue Oct 20, 2022 · 1 comment
Labels
no-stale Avoids issue going stale

Comments

@agners
Copy link
Member

agners commented Oct 20, 2022

Describe the issue

Currently, hotplugging a USB device like /dev/ttyUSB0 or /dev/ttyACM0 (using uart: true add-on configuration) does not update the permissions correctly if CGroupsV2 is used (HAOS 9.x).

Permissions are correctly set when the device, or a device of that same major, is plugged in at boot.

From what I understand, the reason is that systemd crgroup support (which runc calls) requires an existing device with that major for it to be able to resolve the major from /proc/devices. This is at least true when using <major>:* type of rules (which Supervisor is using).

https://github.com/opencontainers/runc/blob/v1.1.4/libcontainer/cgroups/systemd/common.go#L236-L256

Possible solution: Add the <major>:* rules not at start but when the first device of that major is being plugged-in.

Steps to reproduce

  1. Use add-on with uart: true
  2. Start the add-on
  3. Plug-in USB to UART adapter after starting the add-on

Environment details

  • Operating System:: 9.0
  • Supervisor version:: 2022.09.0
  • Home Assistant version:

Supervisor logs

Supervisor logs
Sep 15 20:39:04 ha-fujitsu os-agent[101]: INFO: 2022/09/15 20:39:04 cgroup.go:66: Successfully called runc for '6eda7993251104ee747d13f205a8f776fd7468c0ce8bbfa3774569535547621c', output time="2022-09-15T20:39:04Z" level=warning msg="could not find device group for '99/204' in /proc/devices -- temporarily ignoring rule: {99 204 -1 rwm true}"

System Information

System Information
Paste system info here

@github-actions
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Nov 19, 2022
@agners agners added no-stale Avoids issue going stale and removed stale labels Nov 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-stale Avoids issue going stale
Projects
None yet
Development

No branches or pull requests

1 participant