LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-25-2009, 05:28 PM   #1
Toadman
Member
 
Registered: Aug 2002
Location: Copperas Cove, Texas
Distribution: Ubuntu 20.04 LTS
Posts: 304

Rep: Reputation: 21
chroot: cannot run command `/bin/bash': No such file or directory


I'm still having issues getting named to run chroot'd. I've had some help here which I'm grateful for and from a few others. One thing I found out was that I was using the wrong directory structure when placing my zone files. I've corrected that. I was told that if I were to run

chroot /var/lib/named

I'd be able to see the root file system that named sees. Running that command gives me the output that is in the subject line. I've tried googling the above but can't find anything that pins it down to what's causing it. There is a chroot.conf file in /etc/security however all thats in it is:

# /etc/security/chroot.conf
# format:
# username_regex chroot_dir
#matthew /home

which I take to be a default .conf file that doesn't do anything, though I may be wrong. The manpages don't appear to be very helpful either. Could someone please point me in the right direction.

Chris
 
Old 03-25-2009, 06:37 PM   #2
paulslittlebit
LQ Newbie
 
Registered: Apr 2008
Location: Texas
Distribution: LFS 6.4
Posts: 11

Rep: Reputation: 1
Hello Toadman.
Could you try, opening a terminal and typing
"ls -l /var/lib/named" with out the quotes?
And let us know the response is.

Last edited by paulslittlebit; 03-25-2009 at 06:41 PM.
 
Old 03-25-2009, 06:40 PM   #3
Toadman
Member
 
Registered: Aug 2002
Location: Copperas Cove, Texas
Distribution: Ubuntu 20.04 LTS
Posts: 304

Original Poster
Rep: Reputation: 21
Quote:
Originally Posted by paulslittlebit View Post
Hello Toadman.
Could you try, opening a terminal and typing
"ls -l /var/lib/named" with out the quotes?
And let us know the response is.
[root@localhost ~]# ls -l /var/lib/named
total 24
drwxr-xr-x 2 named root 4096 2009-03-11 20:51 dev/
drwxr-xr-x 2 named root 4096 2009-03-24 17:14 etc/
-rw-r--r-- 1 root root 2954 2009-02-15 05:18 named.ca
dr-xr-xr-x 187 root root 0 2009-03-12 13:16 proc/
drwxr-xr-x 7 named root 4096 2009-03-12 06:16 var/
 
Old 03-25-2009, 06:48 PM   #4
paulslittlebit
LQ Newbie
 
Registered: Apr 2008
Location: Texas
Distribution: LFS 6.4
Posts: 11

Rep: Reputation: 1
We should have seen a line like, " drwxr-xr-x 2 named root 4096 2009-03-11 20:51 bin/"
You may need to do "mkdir /var/lib/named/bin" then "cp /bin/bash /var/lib/named/bin". without the quotes of course.
 
Old 03-25-2009, 06:50 PM   #5
paulslittlebit
LQ Newbie
 
Registered: Apr 2008
Location: Texas
Distribution: LFS 6.4
Posts: 11

Rep: Reputation: 1
Also "chown -vR named /var/lib/named/bin"
 
Old 03-25-2009, 07:18 PM   #6
Toadman
Member
 
Registered: Aug 2002
Location: Copperas Cove, Texas
Distribution: Ubuntu 20.04 LTS
Posts: 304

Original Poster
Rep: Reputation: 21
Quote:
Originally Posted by paulslittlebit View Post
Also "chown -vR named /var/lib/named/bin"
Hmm, still no joy, here is what I have now:

drwxr-xr-x 2 named root 4096 2009-03-25 19:07 bin/
drwxr-xr-x 2 named root 4096 2009-03-11 20:51 dev/
drwxr-xr-x 2 named root 4096 2009-03-24 17:14 etc/
-rw-r--r-- 1 root root 2954 2009-02-15 05:18 named.ca
dr-xr-xr-x 191 root root 0 2009-03-12 13:16 proc/
drwxr-xr-x 7 named root 4096 2009-03-12 06:16 var/

-rwxr-xr-x 1 named root 778412 2009-03-25 19:07 bash*

[root@localhost /]# chroot /var/lib/named
chroot: cannot run command `/bin/bash': No such file or directory

Don't understand what the problem is.
 
Old 03-25-2009, 08:24 PM   #7
paulslittlebit
LQ Newbie
 
Registered: Apr 2008
Location: Texas
Distribution: LFS 6.4
Posts: 11

Rep: Reputation: 1
Ok well after a little more poking around I thank what is going wrong is that you may not have all the files install under /var/lib/named/ a goog source is http://www.linuxfromscratch.org/lfs/

I am not sure what named is maybe a little background.
 
Old 03-25-2009, 08:42 PM   #8
Toadman
Member
 
Registered: Aug 2002
Location: Copperas Cove, Texas
Distribution: Ubuntu 20.04 LTS
Posts: 304

Original Poster
Rep: Reputation: 21
From the manpage

named
is a Domain Name System (DNS) server, part of the BIND 9 distribution from ISC

I use it as a local caching nameserver to speed lookups when running scripts to report spam to NANAS. It appears to be running correctly now with none of the errors I had before and appears to be running chroot'd.

I thank you for your help.

Chris
 
Old 03-25-2009, 08:44 PM   #9
paulslittlebit
LQ Newbie
 
Registered: Apr 2008
Location: Texas
Distribution: LFS 6.4
Posts: 11

Rep: Reputation: 1
Cool Your welcome.
 
Old 03-26-2009, 02:36 AM   #10
Valery Reznic
ELF Statifier author
 
Registered: Oct 2007
Posts: 676

Rep: Reputation: 137Reputation: 137
Quote:
Originally Posted by Toadman View Post
Hmm, still no joy, here is what I have now:

drwxr-xr-x 2 named root 4096 2009-03-25 19:07 bin/
drwxr-xr-x 2 named root 4096 2009-03-11 20:51 dev/
drwxr-xr-x 2 named root 4096 2009-03-24 17:14 etc/
-rw-r--r-- 1 root root 2954 2009-02-15 05:18 named.ca
dr-xr-xr-x 191 root root 0 2009-03-12 13:16 proc/
drwxr-xr-x 7 named root 4096 2009-03-12 06:16 var/

-rwxr-xr-x 1 named root 778412 2009-03-25 19:07 bash*

[root@localhost /]# chroot /var/lib/named
chroot: cannot run command `/bin/bash': No such file or directory

Don't understand what the problem is.
You also need directory lib with whatever
Code:
ldd /bin/bash
shows
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
chroot: cannot run command `/tools/bin/env': No such file or directory Basel Linux From Scratch 10 06-09-2018 02:15 PM
chroot: cannot run command `/bin/bash': Exec format error snakeo2 Linux - Newbie 6 09-28-2010 03:41 AM
chroot: cannot run command `/bin/bash': No such file or directory hubabuba Slackware 5 03-23-2008 05:37 PM
bin/bash:usr/bin/lpr NO SUCH FILE OR DIRECTORY Adibe_Hamm Linux - Newbie 3 10-14-2003 02:30 AM
linux command error message bash: /usr/bin/find: No such file or directory sundaram123 Linux - General 8 04-02-2002 07:18 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:34 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration