LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (http://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   Problems with logging in after finishing the 7.2 LFS book (http://www.linuxquestions.org/questions/linux-from-scratch-13/problems-with-logging-in-after-finishing-the-7-2-lfs-book-4175450548/)

giuliom_95 02-17-2013 10:51 AM

Problems with logging in after finishing the 7.2 LFS book
 
Hi all,
I've just finished to compile my own LFS. I've rebooted and it's all ok until I try to log in: every time after I insert the root credentials and it tolds me the last login date and that there are no new emails, it promts:
Code:

cannot run command `/bin/bash': No such file or directory
and asks me again to log in.
What can I do? the LFS version I've read is the 7.2

spiky0011 02-17-2013 11:15 AM

Hi can you post fstab file

giuliom_95 02-17-2013 11:25 AM

Code:

# Begin /etc/fstab

# file system  mount-point  type    options            dump  fsck
#                                                              order

/dev/sda6      /            ext3    defaults            1    1
proc          /proc        proc    nosuid,noexec,nodev 0    0
sysfs          /sys        sysfs    nosuid,noexec,nodev 0    0
devpts        /dev/pts    devpts  gid=5,mode=620      0    0
tmpfs          /run        tmpfs    defaults            0    0
devtmpfs      /dev        devtmpfs mode=0755,nosuid    0    0

# End /etc/fstab


spiky0011 02-17-2013 11:29 AM

Hi

I have seen this problem I think I had it but cant find the thread, I,ll keep looking by the way fstab ok

spiky0011 02-17-2013 11:44 AM

Can you post /etc/passwd file

druuna 02-17-2013 11:46 AM

Quote:

Originally Posted by giuliom_95 (Post 4893699)
Hi all,
I've just finished to compile my own LFS. I've rebooted and it's all ok until I try to log in: every time after I insert the root credentials and it tolds me the last login date and that there are no new emails, it promts:
Code:

cannot run command `/bin/bash': No such file or directory
and asks me again to log in.
What can I do? the LFS version I've read is the 7.2

The shell to start when logging in is defined in /etc/passwd and seems to point at /bin/bash.
- Do you have a correct root entry in /etc/passwd?
- Does /bin/bash exist?

giuliom_95 02-17-2013 11:47 AM

Quote:

The shell to start when logging in is defined in /etc/passwd and seems to point at /bin/bash.
- Do you have a correct root entry in /etc/passwd?
- Does /bin/bash exist?
/bin/bash file exists and I think that the /etc/passwd file it's ok:
Quote:

root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/dev/null:/bin/false
nobody:x:99:99:Unprivileged User:/dev/null:/bin/false

@spiky: Thanks for replies spiky, but I think that the problem is in the shadow package because also if I try to run 'su' by an "chrooted" system I get the same error! So I've tried to re-compile and re-install shadow but I haven't not got results... Other suggestions?

druuna 02-17-2013 11:49 AM

Quote:

Originally Posted by giuliom_95 (Post 4893753)
Thanks for replies spiky, but I think that the problem is in the shadow package because also if I try to run 'su' by an "chrooted" system I get the same error!

No, the problem is that bash cannot be found and/or executed.

spiky0011 02-17-2013 11:49 AM

post /etc/passwd just to be sure

giuliom_95 02-17-2013 11:53 AM

I've posted /etc/passwd up of this

druuna 02-17-2013 11:57 AM

Is bash executable?
Code:

cd /bin
./bash --version

# and
file bash


giuliom_95 02-17-2013 12:18 PM

Quote:

Originally Posted by druuna (Post 4893764)
Is bash executable?
Code:

cd /bin
./bash --version

# and
file bash


Yes the /bin/bash file is executable (-rwxr-xr-x) and the output of suggested commands are:
Code:

root:/bin# ./bash --version
GNU bash, version 4.2.36(1)-release (i686-pc-linux-gnu)
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Code:

root:/bin# file bash
bash: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.25, not stripped


spiky0011 02-17-2013 12:22 PM

Hi

Not sure if I,m right or it will add info
Code:

echo $SHELL
Dont know if you can run that

giuliom_95 02-17-2013 12:31 PM

Quote:

Originally Posted by spiky0011 (Post 4893783)
Hi

Not sure if I,m right or it will add info
Code:

echo $SHELL
Dont know if you can run that

I can run this only by a chrooted system and I think that it's the same of the host OS but I'll however post the output:
Code:

root:/# echo $SHELL
/bin/bash


druuna 02-17-2013 12:48 PM

Just to be sure: You cannot log into LFS, so am I assuming correctly that all the commands shown above are done on your host and from within the chrooted environment?

I'm asking because this might look strange (not 100% sure):
Quote:

root:/bin# file bash
bash: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.25, not stripped
LFS 7.2 uses kernel/header version 3.5.2 and I would expect this to show and not 2.6.25. But like I said: Not 100% sure about that.


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