Every attempt to use the portage system fails with: /usr/sbin/ebuild.sh: ./configure: /bin/sh: bad interpreter: Permission denied This may be related to a recent portage update, but other than standard system updated I have made no changes of any kind. Reproducible: Always Steps to Reproduce: Example of output: ----------------------------------------------------- Calculating world dependencies ...done! >>> emerge (1 of 5) net-misc/wget-1.9 to / >>> md5 src_uri ;-) wget-1.9.tar.gz gnuconfig >>> Unpacking source... >>> Unpacking wget-1.9.tar.gz to /mnt/shares/portagetmp/portage/wget-1.9/work >>> Source unpacked. gnuconfig * Using GNU config files from /usr/share/gnuconfig * Updating config.sub [ ok ] * Updating config.guess [ ok ] ssl ssl /usr/sbin/ebuild.sh: ./configure: /bin/sh: bad interpreter: Permission denied !!! ERROR: net-misc/wget-1.9 failed. !!! Function econf, Line 338, Exitcode 126 !!! econf failed ------------------------------------------------- From doing a bit of googling and forum searching, I discovered that this can be caused by "sh" being unlisted in /etc/shells. This is not the case: ---------------- sheridan root # cat /etc/shells # /etc/shells: valid login shells # $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/shells,v 1.5 2003/07/15 20:36:32 azarah Exp $ /bin/sh /bin/bash /bin/tcsh /bin/csh /bin/esh /bin/ksh /bin/zsh /bin/sash -------------------- I have some partitions mounted noexec, but they should be unrelated to portage. On the off chance that something executes from /tmp (which would be evil), I remounted /tmp with full permissions, and the problem was still present. (The other noexec partition is TOTALLY unrelated to anything else-- /mnt/backup, on a completely different drive). Here is mount's output: -------------------------------------- sheridan root # mount /dev/sda2 on / type reiserfs (rw,noatime) none on /dev type devfs (rw) none on /proc type proc (rw) /dev/sda3 on /usr type reiserfs (rw,nodev,noatime) /dev/sda5 on /var type reiserfs (rw,nodev,noatime) /dev/sda6 on /home type reiserfs (rw,nosuid,noatime) /dev/sdc1 on /mnt/backup type ext3 (rw,noexec) /dev/sdb1 on /mnt/shares type ext3 (rw,noexec,nosuid,nodev,noatime) tmpfs on /dev/shm type tmpfs (rw) /dev/sda7 on /tmp type reiserfs (rw,noexec,nosuid,nodev,noatime) ------------------------------- Note that 'which sh' points to '/bin/sh ' I have tried clearing some temp files... rm -rf /usr/portage/distfiles/* rm -rf /var/tmp/portage/* rm -rf /tmp/* ...And other than that, the only change made was "prelink -afmR", which I do after every update. sheridan root # emerge info Portage 2.0.49-r15 (default-x86-1.4, gcc-3.2.3, glibc-2.3.2-r1, 2.4.20-gentoo-r8) ================================================================= System uname: 2.4.20-gentoo-r8 i686 AMD Athlon(tm) XP 1800+ Gentoo Base System version 1.4.3.10p1 distcc 2.11.1 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [enabled] ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CFLAGS="-march=athlon -O2 -fomit-frame-pointer -pipe" CHOST="i686-pc-linux-gnu" COMPILER="gcc3" CONFIG_PROTECT="/etc /var/qmail/control /usr/share/config /usr/kde/2/share/config /usr/kde/3/share/config" CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d" CXXFLAGS="-O2 -mcpu=i686 -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs sandbox ccache distcc userpriv" GENTOO_MIRRORS="http://gentoo.oregonstate.edu http://distro.ibiblio.org/pub/Linux/distributions/gentoo" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/mnt/shares/portagetmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="x86 oss apm arts avi crypt encode foomaticdb gif imlib libg++ libwww mad mikmod mpeg ncurses nls oggvorbis pdflib qt quicktime sdl spell svga truetype xml2 xmms xv zlib gdbm berkdb slang readline java mysql gpm perl python tcpd pam ssl -cups -jpeg -tiff -png -X -gtk -gnome -alsa -opengl -motif -kde"
Oops, my fault: PORTAGE_TMPDIR=/mnt/shares/portagetmp The odd thing is, I had emerged ccache after this, and many compilations via distcc were done as well. Might want to mention in the default make.conf that PORTAGE_TMPDIR must be mounted executeable, for those that read the gentoo security doc right after installing the system. Sorry. Nothing to see here, move along...