LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.

Notices

Reply
 
Search this Thread
Old 11-25-2006, 06:12 PM   #1
status1
Member
 
Registered: Sep 2006
Posts: 122

Rep: Reputation: 15
Unhappy expect -c "spawn ls" The system has no more ptys


Hello,
I am building LFS for the first time using the book and the Livecd 6.0
I finally got through installing glibc at chapter 6 after
a few tries and retries and now I have a problem at installing binutils in chapter 6.13.1
At the expect -c "spawn ls" command I get the error that is in the book "the system has no more ptys"
I looked at some of the posts here but I did not find a solution that I can apply to my case
The book says that the chroot environment is not set up for proper PTY operation.
Can someone expand on that to point me in the right direction.
Is it a certain part of the environment ?
Is there a way to check how many ptys the system needs or has ?
 
Old 11-25-2006, 07:47 PM   #2
Daws
Member
 
Registered: May 2006
Location: UK
Distribution: Debian, Linux From Scratch
Posts: 416
Blog Entries: 1

Rep: Reputation: 30
Hello,

I believe this is what you are looking for:

http://www.linuxfromscratch.org//lfs/faq.html#no-ptys

The worst case scenario is recompiling the host system's kernel which isn't too bad.

Cheers

***EDIT***

Hang on a sec you're using the live cd ... that's odd the live cd should be set up properly.
Well you cant recompile the live cd so if the "mknod" instructions don't work then you may want to try the latest version of the live cd (6.2 I believe)

***EDIT***

Last edited by Daws; 11-25-2006 at 07:52 PM.
 
Old 11-26-2006, 05:18 AM   #3
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371
Hi,

This is a /dev related problem (the 'skipping' of populating dev, as stated in a previous post).

Daws is correct, this message should not happen when you use the liveCD as base. You could try Daws link, but I wonder what else will show up.
 
Old 11-26-2006, 09:03 AM   #4
status1
Member
 
Registered: Sep 2006
Posts: 122

Original Poster
Rep: Reputation: 15
Hello,
It seems a little bit confusing to me at the moment.

In the book at chapter 5.13.1 Re-innstallation of GCC when the expect command is used for the first time it says that if I get that message "the system has no more ptys" it says that the HOST does not have it's ptys set up properly.

I did not get that message at that time so I am assuming that the host has
enough ptys or it has the ptys set up properly

So now that I am running the expect command in the chroot environment
at chapter 6.13.1 and I get that message the book says that " the CHROOT environment is not set up for proper pty operation"

What does pty need for proper operation ?
Is there a way to look at the host to see how the pty is set up just for me to get an idea of what a proper pty should look like ?


So from that I am assuming that the host pty is ok or it's not even checking
it although there is no way to tell where it is looking for the ptys.

So I am just guessing here but that link is for the first use of expect

I mean if it was fixed once in chapter 5 why would it happen again or if
it happens now why would I need to fix the host ptys if it worked before ?

So it seems that it has something to do with the chroot environment and not the host I just don't know where or what to look for.
 
Old 11-26-2006, 09:52 AM   #5
Daws
Member
 
Registered: May 2006
Location: UK
Distribution: Debian, Linux From Scratch
Posts: 416
Blog Entries: 1

Rep: Reputation: 30
Quote:
This is a /dev related problem (the 'skipping' of populating dev, as stated in a previous post).
Well if this is the case then entering (as per the book)

Code:
mount --bind /dev $LFS/dev
before entering the chroot environment should fix it
 
Old 11-26-2006, 01:34 PM   #6
status1
Member
 
Registered: Sep 2006
Posts: 122

Original Poster
Rep: Reputation: 15
Hello,
I tried that command but it has no effect.
I still have the same error

Just wanted to add that the command is not in the book (v6.0)
Not that it makes any difference

Last edited by status1; 11-26-2006 at 01:37 PM.
 
Old 11-26-2006, 01:56 PM   #7
Daws
Member
 
Registered: May 2006
Location: UK
Distribution: Debian, Linux From Scratch
Posts: 416
Blog Entries: 1

Rep: Reputation: 30
Sorry my fault that particular command is in versions 6.2 and later, I forgot you were following 6.0.

Well according to the instructions you need /dev/ptmx and a directory called /dev/pts so from inside chroot

Code:
mknod /dev/ptmx c 5 2 &&
chmod 666 /dev/ptmx &&
mkdir /dev/pts &&
chmod 755 /dev/pts
then remount the devpts filesystem

Code:
mount -t devpts -o gid=4,mode=620 none /dev/pts
This assumes you have gone through all the necessary steps to enter the chroot environment, in particular fake mounting devpts.

If this doesn't work then something else v weird is going on or you made a typo somewhere.
 
Old 11-26-2006, 02:42 PM   #8
status1
Member
 
Registered: Sep 2006
Posts: 122

Original Poster
Rep: Reputation: 15
Hello,
Actually something did happen after entering the "mount --bind /dev $LFS/dev"
command.
I have a lot of ttys (about 63) and a bunch of other files none of which I had before
Is that normal ?
Also the ptmx was created which I did not have before.

"Well according to the instructions" Is this from 6.2 also ? I don't hav that in 6.0
I just want to make sure I understand your instructions.
So after entering chroot are those the only commands I should enter or are those in addition to what I am supposed to enter according to 6.0 ?

If this is in addition to the commands in 6.0 this may or may not be important but do I enter those commands before or after the
"mount -n -t ramfs none /dev" command ?
Because it tends to hide the mknod files if I enter it before.
 
Old 11-26-2006, 03:15 PM   #9
status1
Member
 
Registered: Sep 2006
Posts: 122

Original Poster
Rep: Reputation: 15
Hello,
Well those last instructions seem to have worked.
I put in only those commands an tried it and it worked but if I add the rest of the commands it doesn't work again just as I suspected because everything is hidden by the "mount -n -t ramfs none /dev" command

So I am not sure if I need the rest of the commands from the book or maybe just a few.
 
Old 11-26-2006, 05:15 PM   #10
Daws
Member
 
Registered: May 2006
Location: UK
Distribution: Debian, Linux From Scratch
Posts: 416
Blog Entries: 1

Rep: Reputation: 30
Hello again,

Quote:
"Well according to the instructions" Is this from 6.2 also
Sorry I guess my post was a bit ambiguous, to clarify, these were from the lfs FAQ, not the book, it's the link I gave when I first replied.

Quote:
Originally Posted by me
This assumes you have gone through all the necessary steps to enter the chroot environment, in particular fake mounting devpts
.

Again sorry, I could have been more specific.

There are certain commands to run EVERYTIME you want to enter the chroot environment.

This is direct from the 6.0 version:

Before chrooting:

Code:
mount -t proc proc $LFS/proc
mount -t sysfs sysfs $LFS/sys
mount -f -t ramfs ramfs $LFS/dev
mount -f -t tmpfs tmpfs $LFS/dev/shm
mount -f -t devpts -o gid=4,mode=620 devpts $LFS/dev/pts (This is the fake mounting of devpts)
After chrooting go through 6.8.1 and 6.8.2 again to populate dev properly

Quote:
If this is in addition to the commands in 6.0 this may or may not be important but do I enter those commands before or after the
"mount -n -t ramfs none /dev" command ?
You would want to do it after that (after doing section 6.8.2 in fact)

Hope you get it sorted.

ps. congrats on 100 posts
 
Old 11-27-2006, 06:40 PM   #11
status1
Member
 
Registered: Sep 2006
Posts: 122

Original Poster
Rep: Reputation: 15
Hello,
Yes it was clear up to the point of entering chroot . I do those EVERYTIME

It's at 6.8.1 and 6.8.2 that I wanted to make sure I put it in the right order
So I understand that I would have to enter those commands EVERYTIME also ?

"(after doing section 6.8.2 in fact)"
Ammm... I already have a "mount -t devpts -o gid=4,mode=620 none /dev/pts"
as part of 6.8.2.
Should I just skip over that line and place it at the end ?
I imagine I would have to skip over "mkdir /dev/pts" also .
 
Old 02-27-2008, 09:06 PM   #12
PhillipHuang
Member
 
Registered: Aug 2006
Location: Shen Zhen
Distribution: Ubuntu 10.04
Posts: 198

Rep: Reputation: 33
Hello,

I have the same problem in LFS6.3.
(http://www.linuxfromscratch.org/lfs/.../binutils.html).

Later I fix it with the following steps.

1. In original Linux system, log on as root,and check the mount list. for example:
Code:
[root@lfstest local]# mount
/dev/hda1 on / type ext3 (rw)
none on /proc type proc (rw)
none on /sys type sysfs (rw)
none on /dev/pts type devpts (rw,gid=5,mode=620)
none on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
/dev/hda3 on /mnt/lfs type ext3 (rw)
Obviously, no directory on $LFS(which is /mnt/lfs in my system) has been mounted. Now you should to double check if all virtual kernel file system on $LFS have been mounted. If not,

Code:
mount -v --bind /dev $LFS/dev
mount -vt devpts devpts $LFS/dev/pts
mount -vt tmpfs shm $LFS/dev/shm
mount -vt proc proc $LFS/proc
mount -vt sysfs sysfs $LFS/sys
Now, check again:
Code:
[root@lfstest local]# mount
/dev/hda1 on / type ext3 (rw)
none on /proc type proc (rw)
none on /sys type sysfs (rw)
none on /dev/pts type devpts (rw,gid=5,mode=620)
none on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
/dev/hda3 on /mnt/lfs type ext3 (rw)
/dev on /mnt/lfs/dev type none (rw,bind)
devpts on /mnt/lfs/dev/pts type devpts (rw)
shm on /mnt/lfs/dev/shm type tmpfs (rw)
proc on /mnt/lfs/proc type proc (rw)
sysfs on /mnt/lfs/sys type sysfs (rw)
2. Chroot operation,
Code:
[root@lfstest local]# chroot "$LFS" /tools/bin/env -i \
>     HOME=/root TERM="$TERM" PS1='\u:\w\$ ' \
>     PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin \
>     /tools/bin/bash --login +h
3. In the new root, it is fixed the "PTY" problem.
Code:
root:/# expect -c "spawn ls"
spawn ls

Hope it helpful.

Phillip
 
Old 03-29-2008, 08:51 PM   #13
MannyNix
Member
 
Registered: Dec 2005
Location: ~
Distribution: Slackware -current, OpenBSD
Posts: 449

Rep: Reputation: 41
Hi, I had the same problem in LFS6.3
When i saw:
Code:
expect -c "spawn ls" 
The system has no more ptys.
Ask your system administrator to create more.
I just rebooted and continued from:
From section 6.2. Mounting Virtual Kernel File Systems to section 6.8.Populating /dev on: http://www.linuxfromscratch.org/hint...and-resume.txt

Seems it did the trick, hope it helps too
 
  


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
"The system has no more ptys. Ask your system administrator to create more." czeslafff Linux From Scratch 10 07-16-2012 05:15 AM
screen error "no more PTYs" darcon3k Linux - Software 10 04-19-2011 04:30 PM
error in 6.13 binutils~ expect -c"spawn ls" sharmashikha Linux From Scratch 1 06-21-2005 11:53 AM
"there are no more ptys" error!..pls help!! chakkaradeepcc Linux From Scratch 3 05-07-2005 12:48 PM
xterm not spawning "not enough ptys" sohmc Linux - General 4 09-23-2004 07:42 PM


All times are GMT -5. The time now is 05:31 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration