LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   "System has no more ptys" (https://www.linuxquestions.org/questions/linux-from-scratch-13/system-has-no-more-ptys-743904/)

qcinski 07-30-2009 08:04 AM

"System has no more ptys"
 
Hello. I'm building LFS 6.3 and I have troubles in chapter 6.11. After command expect -c "spawn ls" I receive "The system has no more ptys. Ask admin to create more" error. I created some ptys/ttys using MAKEDEV, mounted /dev/pts, chmodded /dev/ptmx, /dev/pts but it's still not working. What should I do?

MensaWater 07-31-2009 02:19 PM

Haven't used LFS but in other OSes this is a kernel parameter.

Try running "sysctl -a |grep pty" - You ought to see something like:
kernel.pty.nr = 5
kernel.pty.max = 4096

According to this site:
http://www.cyberciti.biz/tips/howto-...y-session.html
You can set the pty.max by echoing a new value into /proc/sys/kernel/pty/max e.g.:
echo 9192 >/proc/sys/kernel/pty/max

Accoring to pty man page (type "man pty" to see it). The pty.nr is the number currently in use and the pty.max is the number allowed.

Also on checking with my CentOS 5 install I was able to change the value by doing the echo and also by adding line to /etc/sysctl.conf then running "sysctl -p /etc/sysctl.conf". The line added to sysctl.conf was like this:
kernel.pty.max = 9192

Note that you can NOT set kernel.pty.nr that way as it is dynamic view of what is in use. Also you may not be able to do this if your kernel is earlier than 2.6.3 based on the comments in the man page as it was formerly done by how many you had configured at compile of kernel.

qcinski 08-01-2009 06:43 AM

Thanks, it helped


All times are GMT -5. The time now is 10:24 AM.