Operating System - HP-UX
1825747 Members
2890 Online
109687 Solutions
New Discussion

Re: Creating pty device files

 
SOLVED
Go to solution
Rumen Ginev
Frequent Advisor

Creating pty device files

Hi!
When someone tries to telnet to the system (K260/HP-UX10.20) conection is
closed immediately. The message in syslog is:
telnetd[13420]: Cannot allocate pty
The kernel parameters related to ptys I found are:
npty - 800
nstrpty - 60
nclist - 12900
I think the problem is there are not enough pty (slave/master) device files.
If this is the problem, how to create more pty device files?

Thanks in advance,
Rumen
5 REPLIES 5
Alex Glennie
Honored Contributor
Solution

Re: Creating pty device files

i'd try increasing nstrpy value first ...
to increase the ptys :

insf -d pty0 -n 200
insf -d pty1 -n 200 etc ...
Bruce Regittko_1
Esteemed Contributor

Re: Creating pty device files

Hi,

nstrpty is probably the culprit. This sets the maximum number of streams based PTYs allowed on the system. Use sam to change this configurable kernel parameter.

More information can be found at http://docs.hp.com/hpux/onlinedocs/os/KCparams.OverviewAll.html.

--Bruce
www.stratech.com/training
Rumen Ginev
Frequent Advisor

Re: Creating pty device files

Tanks again!

I increased pty device files by:

insf -d ptym -n 150
insf -d ptys -n 150

where ptym and ptys are kernel drivers (from lsdev). Now I have 150 device files under /dev/ptym/ and /dev/pty/ for master and slave parts of a pty respectively.

nstrpty kernel parameter is related to the number of device files under /dev/pts/, so I did not change it.

I do not know why, but this solved the problem.

Could someone send links to documents that clarify the things about the pseudo teminals and how telnetd works with them?

Rumen
Bruce Regittko_1
Esteemed Contributor

Re: Creating pty device files

Hi again,

Sorry - I was thinking of dtterm, which uses pts device files.

For more information, check the man pages for pts(7), pty(7), and ptm(7).

--Bruce
www.stratech.com/training
James R. Ferguson
Acclaimed Contributor

Re: Creating pty device files

Hi Rumen:

Document #KBRC00000945 should help you. In part:

PTYs are used to open telnet sessions. On 10.x systems they use PTYs(pseudo-terminal) and 11.x systems use PTYs that are pseudo-terminal and Streams-Based.

To check the number of telnet sessions you have available, on the box refusing the connection do:

ls /dev/pty | wc -w
ls /dev/ptym | wc -w

To increase your telnet sessions, increase 'npty'.

1. Use SAM -> Kernel -> Configurable Parameters

npty (10.20 and 11.0)
nstrpty (11.0 only)

Set NPTY and NSTRPTY to 512 where NPTY and NSTRPTY are the desired number of telnet sessions.

2. Rebuild the special device files as follows:

# insf -d ptys -n 512

...(10.20 and 11.0).

# insf -d ptym -n 512
...(10.20 and 11.0)

# insf -d pts -s 512 -e -v
...(for 11.0 only)

...JRF...