1821984 Members
3319 Online
109638 Solutions
New Discussion юеВ

/dev/pts numbering

 
Brad Marks
Super Advisor

/dev/pts numbering

I am preparing a 11.i system for >200 users. An application we use needs to know what the order of /dev/pts use is. For example, the first telnet session is assinged /dev/pts/ta, the second /dev/pts/tb, etc.
I have created 1000 entries in /dev/pts: 'ta' through 'tzp'.
What order are they used in?
I've found that after 'tz', 'tA' is used. What will come after tZ?

Thanks!
Brad
It's not impossible -- it'll just cost more...
4 REPLIES 4
Bill Hassell
Honored Contributor

Re: /dev/pts numbering

Wow, that was a lot of work that is automatically performed by insf. The naming conventions are *NOT* 100% sequential. For instance, the letter d is not used. See:

man 7 pty

But to make things extremely simple, you can run SAM and increase the npty value in the kernel to 1000 (always required or the extra device files will never be used) and SAM will run insf for you. Since you have to change the kernel, SAM is by far the simplest method.

Another note: you'll also need to increase the nstrpty and nstrtel values as many network daemons now use streams-based code to handle pseudo terminal connections. The best choice is to make npty = nstrpty = nstrtel = 1000.


Bill Hassell, sysadmin
Brad Marks
Super Advisor

Re: /dev/pts numbering

I did use insf to create the entries in /dev/pts.
Thank you for the kernel parameter info.

I looked at the man pages for pty and pts and don't see any reference to the order in which the files are used.
Any further help would be greatly appreciated.
Thanks,
Brad
It's not impossible -- it'll just cost more...
Steven E. Protter
Exalted Contributor

Re: /dev/pts numbering

I have found in general, they seem to be allocated in the sort order you'd get by doing an ls command in the directory in /dev that they reside after creation by insf -e

Thats just observation from a trouble call I spent with HP years ago on an 11.00 box.

However during that process for reasons I don't understand the order of allocation was not always consistent. That could be because we had a few corrupt pty's. Or it could be the allocation scheme is different than what I think I observed.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Bill Hassell
Honored Contributor

Re: /dev/pts numbering

The device file names are at the bottom of man 7 pty (don't foget the 7):

FILES
/dev/ptym/pty[a-ce-z][0-9][0-9] master pseudo terminals
/dev/ptym/pty[a-ce-z][0-9][0-9][0-9] master pseudo terminals
/dev/ptym/pty[a-ce-z][0-9a-f] master pseudo terminals
/dev/pty[pqr][0-9a-f] master pseudo terminals
/dev/pty/tty[a-ce-z][0-9][0-9] slave pseudo terminals
/dev/pty/tty[a-ce-z][0-9][0-9][0-9] slave pseudo terminals
/dev/pty/tty[a-ce-z][0-9a-f] slave pseudo terminals
/dev/tty[pqr][0-9a-f] slave pseudo terminals

The filenames are shown in regular expressions. [ac-ez] means there is no d in the sequence. The good news is that insf knows all the rules and will populate the directories with the appropriate device files. insf -e will recreate any missing or problem device files. Make sure that the 3 kernel paramters are set correctly first (hint: kmtune | grep -e nstr -e pty)


Bill Hassell, sysadmin