Unix Technical Forum

SEO

vBulletin Search Engine Optimization


Go Back   Unix Technical Forum > Unix Operating Systems > Gentoo Linux Support

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-21-2008, 12:20 PM
Mark Hobley
 
Posts: n/a
Default netkit-telnetd: error during build: /bin/sh: bad interpreter

I am having a problem building the telnet server daemon on my Gentoo
box:

whoami
root
emerge netkit-telnetd
>>> Unpacking source...
>>> Unpacking netkit-telnet-0.17.tar.gz to

/local/var/tmp/portage/net-misc/netkit-telnetd-0.17-r6/work
>>> Unpacking netkit-telnet_0.17-28.diff.gz to

/local/var/tmp/portage/net-misc/netkit-telnetd-0.17-r6/work
* Applying netkit-telnet_0.17-28.diff ... [ ok ]
* Applying netkit-telnetd-0.17-cflags-gnu_source.patch ... [ ok ]
>>> Source unpacked.
>>> Compiling source in

/local/var/tmp/portage/net-misc/netkit-telnetd-0.17-r6/work/netkit-telnet-0.17
....
/usr/portage/net-misc/netkit-telnetd/netkit-telnetd-0.17-r6.ebuild:
../configure:
/bin/sh: bad interpreter: Permission denied
*
* ERROR: net-misc/netkit-telnetd-0.17-r6 failed.
* Call stack:
* ebuild.sh, line 1695: Called dyn_compile
* ebuild.sh, line 1033: Called qa_call
'src_compile'
* ebuild.sh, line 44: Called src_compile
* netkit-telnetd-0.17-r6.ebuild, line 44: Called die
* The specific snippet of code:
* e--./configure --prefix=/usr || die
* The die message:
* (no error message)
*
* If you need support, post the topmost build error, and the call stack
if relevant.
* A complete build log is located at
'/local/var/tmp/portage/net-misc/netkit-telnetd-0.17-r6/temp/build.log'.
*

Hmmm, what the hell is going on. I am concerned about the error:
/bin/sh: bad interpreter: Permission denied

I am root, and the drive is local. Why do I have this error?

whoami
root
ls -l /bin/sh
lrwxrwxrwx 1 root root 4 Nov 1 22:47 /bin/sh -> bash
ls -l /bin/bash
-rwxr-xr-x 1 root root 651148 Nov 1 22:46 /bin/bash
whoami
root
/bin/sh
sh-3.2# whoami
root
sh-3.2# exit
whoami
root

Thanks in advance to anyone who can help.

Mark.

--
Mark Hobley,
393 Quinton Road West,
Quinton, BIRMINGHAM.
B32 1QE.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-21-2008, 12:20 PM
David W Noon
 
Posts: n/a
Default Re: netkit-telnetd: error during build: /bin/sh: bad interpreter

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sunday 20 Jan 2008 21:08 in article
<79oc65-n2b.ln1@neptune.markhobley.yi.org> of alt.os.linux.gentoo, Mark
Hobley(markhobley@hotpop.donottypethisbit.com) wrote:

[snip]
> /bin/sh: bad interpreter: Permission denied


This sometimes arises when your shell is being loaded from a physical
filesystem that has been mounted, implicitly or explicitly,
with "noexec" in its mount options. Since the name is "/bin/sh", this
would indicate a chroot jail on a noexec filesystem.

There could be other reasons too, but since Portage uses chroot, the
above one sticks out in my mind.
- --
Regards

Dave [RLU#314465]
================================================== ====
dwnoon@spamtrap.ntlworld.com (David W Noon)
Remove spam trap to reply via e-mail.
================================================== ====

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.7 (GNU/Linux)

iD8DBQFHk90/9MqaUJQw2MkRAobjAKCAkz3ysTp0LAlqPUDCDoEOf3tlzQCgqU m9
ZZVUFNobHAK/qjKaEO0ZuvY=
=1BRJ
-----END PGP SIGNATURE-----
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-21-2008, 12:20 PM
Mark Hobley
 
Posts: n/a
Default Re: netkit-telnetd: error during build: /bin/sh: bad interpreter

David W Noon <dwnoon@spamtrap.ntlworld.com> wrote:

> Since the name is "/bin/sh", this would indicate a chroot jail on a noexec
> filesystem.


You might be on to something there. I don't know portage that well. I am
a new user of Gentoo, but on my system /tmp, /home, and /var are all
symlinks to subdirectories of /local, which is a noexec filesystem.

That is odd though, because I have managed to emerge other packages on
the same system without any problems, although I am in the early stages of
deployment.

I wonder what is different about telnetd that causes it to error, but
other packages like tree and less build ok. Why didn't they use a
chroot?

Where does portage build the chroot and can I change this?

I'm wondering what to do about the chroot now. I don't really want to
remove the noexec, unless I have to, but at the same time, I don't want
to move the chroot to /usr.

I need to somehow maintain access to the local binaries, rather than
have them copying to a chroot jail. I might be able to do some sort of
loop mount for this, but I haven't tested that.

Another alternative may be to loop mount the chrooted /bin directory,
this time permitting exec on the loop mount, but I have not tested this.

Is there some configuration changes that I can make to portage for that?
or can I switch the chroot off, and possibly use fakeroot instead?

(I'll obvious need to be root to install, but I could do this manually.)

Mark.

--
Mark Hobley,
393 Quinton Road West,
Quinton, BIRMINGHAM.
B32 1QE.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-21-2008, 12:20 PM
Mark Hobley
 
Posts: n/a
Default Re: netkit-telnetd: error during build: /bin/sh: bad interpreter

Mark Hobley <markhobley@hotpop.donottypethisbit.com> wrote:
> David W Noon <dwnoon@spamtrap.ntlworld.com> wrote:
>
>> Since the name is "/bin/sh", this would indicate a chroot jail on a noexec
>> filesystem.

>
> You might be on to something there. I don't know portage that well. I am
> a new user of Gentoo, but on my system /tmp, /home, and /var are all
> symlinks to subdirectories of /local, which is a noexec filesystem.


It must have been this. I remounted /local with execute permissions, and
the package build completed normally.

Cheers,

Mark.

--
Mark Hobley,
393 Quinton Road West,
Quinton, BIRMINGHAM.
B32 1QE.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 07:06 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145