1748227 Members
4398 Online
108759 Solutions
New Discussion юеВ

pty or pts devices

 
SOLVED
Go to solution
TMcB
Super Advisor

pty or pts devices

We still have several 10.20 servers, and are finally getting a chance to configure a 11.0 server for upgrade testing.

The only thing I have noticed is that on
10.20 - when I do 'ps -ef' or 'who' all users show as ttyxx or pty/ttyxx.

On our 11.0 test server when I do 'who' the users are now showing as pts/tx. Also when I do a 'ps -ef' or 'top' most processes have a ? as a terminal type.

Your help is much appreciated.
5 REPLIES 5
Pete Randall
Outstanding Contributor

Re: pty or pts devices

In our environment, the majority of our users connect by logging in to CDE through Reflections/X software on their PC. These users show as pty/tty. Many of our development staff run Linux on their PC's and connect directly to the Xsession manager on the server they wish to connect to. They show up as pts/tx.

Maybe this will help you shed some light on the subject.


Pete


Pete
Michael Tully
Honored Contributor
Solution

Re: pty or pts devices

I think this is correct.
Under 10.20 the pseudo ttys used be controlled by the 'npty' kernel parameter. The 11.x system are looked after by the 'nstrtel' kernel parameter. See the document here:

http://docs.hp.com/cgi-bin/otsearch/getfile?id=/hpux/onlinedocs/939/KCParms/KCparams.OverviewAll.html&searchterms=parameters%7ckernel&queryid=20030826-050625

I usually create an abundance of all of them. nstrtel, npty & nstrpty parameters set at 1024. Here's how to create the devices. pts are created from the last command.
# cd /dev
# insf ???d pty ???s 1024 ???e ???v
# insf ???d ptm ???s 1024 ???e ???v
# insf -d telm ???s 1024 ???e ???v
# insf -d tels ???s 1024 ???e -v
Anyone for a Mutiny ?
TMcB
Super Advisor

Re: pty or pts devices

Thanks for the replies.

I'm still confused as to why, when I run top or ps -ef , the tty column displays a question mark against each process.

Thanks
Tim Adamson_1
Honored Contributor

Re: pty or pts devices

The difference is caused by using streams based psuedo-terminal drivers.

The 11.00 release notes show:

Beginning with HP-UX 10.30, the pseudo-terminal in the telnet/telnetd internet service uses two STREAMS-based pseudo-terminal drivers (telm and tels). Because of this, you must tune NSTRTEL, a new kernel parameter for telnet pseudo-terminals.

NSTRTEL specifies the number of telnet slave devices to be created. The number of telnet sessions is limited by the value of NSTRTEL. The default value of NSTRTEL is 60 and the maximum possible value is set by MAX_STRTELS. Note that if you want to change the value of NSTRTEL, you can use SAM, but you can only increase the value beyond the default of 60 (you cannot make the value less than 60). If you do increase the value, the additional
devices will automatically be created. If a user tries to telnet to a system that does not have any telnet pseudo-terminals available, an appropriate error message is displayed.

The device files are placed in /dev/pts and are named "t0", "t1", and so on.

For more information on telnet, refer to the telnet(1) and telnetd(1M) manpages.


As for the top issue, all the ? entries will be kernel threads and daemons.


Hope it helps. Not the most elegant answer but a clue.


Tim
Yesterday is history, tomorrow is a mystery, today is a gift. That's why it's called the present.
Mike Stroyan
Honored Contributor

Re: pty or pts devices

There are actually three different types of pty device on 11.00 and beyond.

classic pty - man pty
used by hpterm, script, and ied
limited by npty kernel tunable

stream pty - man ptm, man pts
used by dtterm, rlogin, and gnome-terminal
limited by nstrpty kernel tunable

telnet pty - man telm, man tels
used by telnet
limited by nstrtel kernel tunable