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

Add process control plug #14

Merged
merged 6 commits into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ Connect the [`bluez`](https://snapcraft.io/docs/bluez-interface) interface for d
sudo snap connect chip-tool:bluez
```

Connect the [`process-control`](https://snapcraft.io/docs/process-control-interface) interface for system-wide process management. This is needed to grant Chip Tool access to make [sched_setattr](https://man7.org/linux/man-pages/man2/sched_setattr.2.html) system calls. This may improve the reliability of the operations (see https://github.com/canonical/chip-tool-snap/issues/8).
```bash
sudo snap connect chip-tool:process-control
```

> **Note**
> On **Ubuntu Core**, the `avahi-control` and `bluez` interfaces are not provided by the system.
>
Expand Down
1 change: 1 addition & 0 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ apps:
- network
- bluez
- avahi-observe
- process-control
Copy link
Member

Choose a reason for hiding this comment

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

Why is process-control interface being added? As issue #8 shows, snappy-debug suggests this interface because there is a seccomp violation on a sched_setattr system call. Is this affecting the functionality?

See also https://snapcraft.io/docs/debug-snaps#heading--seccomp

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it does affect the functionality. Please see the PR description has been updated to include an explanation.

The solution, which involves running the scmp_sys_resolver command to solve the Seccomp violation, appears to be less user-friendly compareing to simply adding the process-control plug.

Copy link
Member

@farshidtz farshidtz Oct 16, 2023

Choose a reason for hiding this comment

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

Yes, it does affect the functionality. Please see the PR description has been updated to include an explanation.

The solution, which involves running the scmp_sys_resolver command to solve the Seccomp violation, appears to be less user-friendly compareing to simply adding the process-control plug.

The data you shared shows the same success rate (4/50 timeouts) with and without connecting the interfaces. The delays may be caused by external networking and computing factors; it appears that the tests have been done in batches without randomization.

I'm not sure what solution are you referring to, involving scmp_sys_resolver. The shared document uses that command to resolve the syscall name from its ID.

environment:
# Replace the path for chip-tool configuration files
TMPDIR: "/mnt"