System has no more ptys; GCC-3.3.1, Pass 2

Greg Schafer gschafer at
Tue Nov 25 17:42:07 PST 2003

On Sun, Nov 23, 2003 at 10:25:17PM -0600, Rob D. wrote:
> I'm currently working through the LFS-5.0 book using an LFS-4.0 system 
> as the host.  I'm working on GCC-3.3.1, pass 2.  I got the error message 
> it lists in the book, "The system has no more ptys.  Ask your system 
> administrator to create more."  The book suggests that my host 
> distribution isn't properly set up for PTY operation, and I'm not 
> suprised of this because it was one of the things I didn't really 
> understand when I did the LFS-4.0 book.
> Specifically, the error message I get for executing
> /expect -c "spawn ls/ is "The system has no more ptys.  Ask your system 
> administrator to create more."  If I execute this as root, it works just 
> fine, though.  I've done some googling, but couldn't find any definitive 
> solutions to the problem.  The book suggests looking through the wiki, 
> but I didn't find any answers there, either.
> I've got devpts mounted on /dev/pts and the kernel has devpts compiled 
> in.  Can anyone offer any insights into the problem?  Any help at all 
> would be appreciated.

The running kernel also needs supports for Unix98 ptys as well as devpts.
i.e. this should in the kernel .config used to build the kernel:


This entry needs to be in the host's fstab:

devpts   /dev/pts   devpts   gid=4,mode=620   0 0

then mount devpts

If you still get can't get the pty's working then you'll need to ensure
that the file called "/tools/libexec/pt_chown" has these permissions:

-rwsr-xr-x    1 root     root         5772 Nov 25 14:38 pt_chown

Something like this (as root):

chown root:root /tools/libexec/pt_chown
chmod 4755 /tools/libexec/pt_chown

should achieve the goal. NOTE - once setup like this, you may have to
execute the 'expect -c "spawn ls"' test twice, Don't ask me why.

The reason for having to do the above is that we install Glibc in Ch 5 as non-root, 
and the Makefile bits that normally do the setup fail (but get ignored):

/bin/install -c -m 4755 -o root /mnt/hdb6/home/gws/scratch/testing/glibc-build/login/pt_chown /tools/libexec/pt_chown
/bin/install: cannot change ownership of `/tools/libexec/pt_chown': Operation not permitted
make[2]: [/tools/libexec/pt_chown] Error 1 (ignored)

Someone may want to stick the above text into the wiki.

More information about the lfs-support mailing list