Bug 1298228
| Summary: | mock --new-chroot behaves differently running SRPM build vs running interactive shell | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Vít Ondruch <vondruch> |
| Component: | ruby | Assignee: | Jeroen van Meeuwen <vanmeeuwen+fedora> |
| Status: | CLOSED UPSTREAM | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | rawhide | CC: | jdisnard, johannbg, lnykryn, mebrown, Mikhail_Campos-Guadamuz, mmorsi, msekleta, msimacek, msuchy, mtasaka, muadda, praiskup, ssahani, s, strzibny, systemd-maint, tagoh, vanmeeuwen+fedora, vondruch, williams, zbyszek |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2016-11-08 14:15:12 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Vít Ondruch
2016-01-13 14:39:06 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 24 development cycle. Changing version to '24'. More information and reason for this action is here: https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora24#Rawhide_Rebase I can reproduce the issue with mock-1.2.18-1 Seems like an issue of systemd:
Steps to reproduce:
1. echo "spawn('ruby -v', :pgroup=>2)" > test.rb
2. mock -r fedora-24-x86_64 --copyin test.rb /test.rb
3. su -
4. /usr/bin/systemd-nspawn -q -D /var/lib/mock/fedora-24-x86_64/root
5. -bash-4.3# su -c "/usr/bin/ruby /test.rb" - mockbuild
/test.rb:1:in `spawn': Operation not permitted - setpgid (Errno::EPERM)
from /test.rb:1:in `<main>
6. /usr/bin/systemd-nspawn -q -D /var/lib/mock/fedora-24-x86_64/root su -c "/usr/bin/ruby /test.rb" - mockbuild
7. echo $?
0
It was expected the step 6 to end up with EPERM error as it was at step 5. Also, with :pgroup>=3 everything seems to be ok.
So mock is only used to set up the chroot environment and it can be reproduced with plain systemd-nspawn. Changing component to systemd. I don't see a bug here. When run with nspawn directly, the pgid happens to be 2, so setpgid(…, 2) succeeds and is a noop, but when run in the other way, it happens to be different (19 here), and setpgid(…, 2) fails. So the difference is expected. I didn't look at the code but it seems that the ruby test suite assumes that 2 cannot be used as a pgid. The test suite seems to be rather naive about the pgroup. I'm going to disable the test and report the issue upstream. Closing this now. |