runc icon indicating copy to clipboard operation
runc copied to clipboard

[debug] Int test for #3551

Open kolyshkin opened this issue 2 years ago • 1 comments

Making sure the test fails before the fix

kolyshkin avatar Aug 11 '22 01:08 kolyshkin

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

kolyshkin avatar Aug 11 '22 01:08 kolyshkin

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

thaJeztah avatar Aug 16 '22 13:08 thaJeztah

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 avatar Aug 17 '22 22:08 kolyshkin

Hmm, I am having a problem reproducing this.

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

kolyshkin avatar Aug 17 '22 22:08 kolyshkin

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 avatar Aug 17 '22 23:08 kolyshkin