Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 667243
Summary: | user with zsh as shell can't easily run chroot | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | James Antill <james.antill> |
Component: | mock | Assignee: | David Cantrell <dcantrell> |
Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | medium | Docs Contact: | |
Priority: | low | ||
Version: | 13 | CC: | aquini, dcantrell, kdudka, mebrown, ovasik, twaugh, williams |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | mock-1.1.10-1.el6 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2011-01-17 08:43:53 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
James Antill
2011-01-04 22:14:58 UTC
James, mock just runs /usr/sbin/chroot; it's chroot that's picking up the value of $SHELL. As a work around you can specify what to run like this: $ mock -r fedora-14-x86_64 --shell /bin/sh which should do the "right" thing. I'll see if there's an easy way to deal with things like /bin/zsh; maybe just nuke the SHELL environment variable before we run the shell, which would force chroot to default to /bin/sh Yeh, I eventually worked out to add /bin/sh to the end (I think previously I'd usually just done an "install zsh", which also works :) it was just annoying and took me a while. I didn't realize this was a chroot feature though, and given that chroot also fails: % sudo chroot /var/lib/mock/fedora-14-i386/root chroot: failed to run command `/bin/zsh': No such file or directory ...I'm going to reassign to coreutils. well, I can modify the shell invocation inside mock to include "SHELL='/bin/sh'" and that would default everyone to sh. Like so: status = os.system("SHELL='/bin/sh' PS1='mock-chroot> ' /usr/sbin/chroot %s %s %s" % (arg, chroot.makeChrootPath(), cmd)) Would this work for you? James, could you please explain what exactly is the bug here? chroot expects valid shell in SHELL envvar and this is perfectly documented - see info documentation - info chroot invocation. I see no bug in chroot and I think the proper solution in mock is the one proposed by Clark in comment #3. Ondrej, this is the bug: % echo $SHELL /bin/zsh % ls -l $SHELL -rwxr-xr-x. 1 root root 689944 Mar 22 2010 /bin/zsh % sudo chroot /var/lib/mock/fedora-14-i386/root chroot: failed to run command `/bin/zsh': No such file or directory ...here $SHELL is valid for the main system, it just isn't valid for every chroot on the system. Saying that $SHELL must be valid for every possible chroot seems of dubious value (and I assume the only reason you haven't got 666 BZs already is because most people have bash, which is in almost all chroots). mock-1.1.8 has added the 'SHELL=/bin/sh' to the chroot invocation, so everyone should be using /bin/sh in the chroot now. (In reply to comment #5) > Ondrej, this is the bug: > > % echo $SHELL > /bin/zsh > % ls -l $SHELL > -rwxr-xr-x. 1 root root 689944 Mar 22 2010 /bin/zsh > % sudo chroot /var/lib/mock/fedora-14-i386/root > chroot: failed to run command `/bin/zsh': No such file or directory I agree with Ondrej. There is nothing to fix in chroot. Info documentation states: "`chroot' changes the root to the directory NEWROOT (which must exist) and then runs COMMAND with optional ARGS. If COMMAND is not specified, the default is the value of the `SHELL' environment variable or `/bin/sh' if not set, invoked with the `-i' option." chroot utility has nothing to do with "no zsh in every chroot on the system" - this has to be covered by user. You can't use the shell binary from old chroot, as the binary could be (and many times is) dynamically linked and the .so files probably will be missing in chroot as well. Closing NOTABUG, as this is not a bug in chroot command and current behaviour is documented. mock-1.1.8-1.fc14 has been submitted as an update for Fedora 14. https://admin.fedoraproject.org/updates/mock-1.1.8-1.fc14 mock-1.1.8-1.fc13 has been submitted as an update for Fedora 13. https://admin.fedoraproject.org/updates/mock-1.1.8-1.fc13 mock-1.0.15-1.el5 has been submitted as an update for Fedora EPEL 5. https://admin.fedoraproject.org/updates/mock-1.0.15-1.el5 mock-1.1.8-1.fc14 has been pushed to the Fedora 14 stable repository. If problems still persist, please make note of it in this bug report. There has been nothing changed in coreutils. I am reassigning back to mock in order to avoid unnecessary confusion... mock-1.1.9-1.fc13 has been submitted as an update for Fedora 13. https://admin.fedoraproject.org/updates/mock-1.1.9-1.fc13 mock-1.0.16-1.el5 has been submitted as an update for Fedora EPEL 5. https://admin.fedoraproject.org/updates/mock-1.0.16-1.el5 mock-1.1.9-1.el6 has been submitted as an update for Fedora EPEL 6. https://admin.fedoraproject.org/updates/mock-1.1.9-1.el6 mock-1.1.9-1.fc14 has been submitted as an update for Fedora 14. https://admin.fedoraproject.org/updates/mock-1.1.9-1.fc14 mock-1.1.9-1.fc14 has been pushed to the Fedora 14 stable repository. If problems still persist, please make note of it in this bug report. mock-1.1.9-1.fc13 has been pushed to the Fedora 13 stable repository. If problems still persist, please make note of it in this bug report. mock-1.1.10-1.fc15 has been submitted as an update for Fedora 15. https://admin.fedoraproject.org/updates/mock-1.1.10-1.fc15 mock-1.1.10-1.fc14 has been submitted as an update for Fedora 14. https://admin.fedoraproject.org/updates/mock-1.1.10-1.fc14 mock-1.0.17-1.el5 has been submitted as an update for Fedora EPEL 5. https://admin.fedoraproject.org/updates/mock-1.0.17-1.el5 mock-1.1.10-1.fc13 has been submitted as an update for Fedora 13. https://admin.fedoraproject.org/updates/mock-1.1.10-1.fc13 mock-1.1.10-1.el6 has been submitted as an update for Fedora EPEL 6. https://admin.fedoraproject.org/updates/mock-1.1.10-1.el6 mock-1.1.10-1.fc15 has been pushed to the Fedora 15 stable repository. If problems still persist, please make note of it in this bug report. mock-1.1.10-1.fc14 has been pushed to the Fedora 14 stable repository. If problems still persist, please make note of it in this bug report. mock-1.1.10-1.fc13 has been pushed to the Fedora 13 stable repository. If problems still persist, please make note of it in this bug report. mock-1.0.17-1.el5 has been pushed to the Fedora EPEL 5 stable repository. If problems still persist, please make note of it in this bug report. mock-1.1.10-1.el6 has been pushed to the Fedora EPEL 6 stable repository. If problems still persist, please make note of it in this bug report. |