Skip to content

Comments

[debug] Int test for #3551#3555

Closed
kolyshkin wants to merge 1 commit intoopencontainers:release-1.1from
kolyshkin:1.1-test-dev-pts
Closed

[debug] Int test for #3551#3555
kolyshkin wants to merge 1 commit intoopencontainers:release-1.1from
kolyshkin:1.1-test-dev-pts

Conversation

@kolyshkin
Copy link
Contributor

@kolyshkin kolyshkin commented Aug 11, 2022

Making sure the test fails before the fix (for #3559 / #3554)

@kolyshkin
Copy link
Contributor Author

Hmm, I am having a problem reproducing this. Perhaps we need to have some special (non-default) device rules, such as those set in containerd. Could you some help with this

@thaJeztah
Copy link
Member

@kolyshkin not sure if relevant for the CI environment, but in moby/moby#43960 I noticed that the failures only occurred with SELinux in enforce mode.

@kolyshkin kolyshkin force-pushed the 1.1-test-dev-pts branch 2 times, most recently from afe291f to 4cb51db Compare August 16, 2022 21:53
@kolyshkin
Copy link
Contributor Author

Ah! Finally reproduced that locally:

[kir@kir-rhat runc-tst]$ sudo ./runc --systemd-cgroup run -d 234
[kir@kir-rhat runc-tst]$ sudo ./runc --systemd-cgroup exec -t 234 sh -c 'ls -l /proc/self/fd/0; echo 123'
lrwx------    1 root     root            64 Aug 17 22:13 /proc/self/fd/0 -> /dev/pts/0
123
[kir@kir-rhat runc-tst]$ sudo ./runc --systemd-cgroup exec -t 234 sh -c 'ls -l /proc/self/fd/0; echo 123'
lrwx------    1 root     root            64 Aug 17 22:13 /proc/self/fd/0 -> /dev/pts/0
123
[kir@kir-rhat runc-tst]$ sudo systemctl daemon-reload
[kir@kir-rhat runc-tst]$ sudo ./runc --systemd-cgroup exec -t 234 sh -c 'ls -l /proc/self/fd/0; echo 123'
ERRO[0000] exec failed: unable to start container process: open /dev/pts/0: operation not permitted 

@kolyshkin
Copy link
Contributor Author

Hmm, I am having a problem reproducing this.

Ah! It was missing -t from the runc exec 🤦🏻

v2: use daemon-reexec
v3: require root to reload systemd
v4: use exec -t

Signed-off-by: Kir Kolyshkin <[email protected]>
@kolyshkin
Copy link
Contributor Author

OK, the test fails for ci / test jobs (recent Ubuntu) as well as for CentOS 8, 9, and Fedora 36.

For some reason it does not fail for CentOS 7 -- I guess the version of systemd in there does not reload device rules upon systemctl daemon-reload.

@kolyshkin kolyshkin closed this Aug 17, 2022
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.

2 participants