Description of problem: mock documentation says it runs /bin/sh with "mock shell" but it actually appears to run the users $SHELL ... which is the same if the user has bash, not so much if the user has zsh. Changing it to always use /bin/sh is probably the simplest thing. I guess the "best" thing might be using $SHELL iff that file exists in the chroot? Version-Release number of selected component (if applicable): mock.noarch 1.1.6-1.fc13 @updates
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.