1850719 Members
3584 Online
104055 Solutions
New Discussion

Which pts is next?

 
SOLVED
Go to solution
A. Daniel King_1
Super Advisor

Which pts is next?

Hi, folks.

I???ve got an interesting situation where it seems that two users are using the same pseudo-terminal. It does not appear to be a ???su??? type of situation.

It would seem that one user, whose processes ran yesterday, terminated his telnet window. The second user logged in today, and has newer processes.

So, my question is, what is the mechanism that determines the next pts number to be allocated to telnetd?

Example:

$ ps ???ef | grep ???/tt???
UID PID PPID C STIME TTY TIME COMMAND
ralph 15012 15011 0 Mar 24 pts/tt 0:00 -ksh
ralph 15451 15012 0 Mar 24 pts/tt 0:00 /usr/bin/ksh /usr/local/bin/chx
root 15011 1 0 Mar 24 pts/tt 0:00 telnetd
daniel 16137 15451 255 Mar 24 pts/tt 1372:21 /bin/ksh /usr/local/bin/menu
bill 4039 0 0 07:34:47 pts/tt 0:00 /usr/bin/ksh /usr/local/bin/chx

Thanks,
Command-Line Junkie
3 REPLIES 3
Steven E. Protter
Exalted Contributor
Solution

Re: Which pts is next?

Last time I looked at it, HP-UX 11.00 pts assignment appeared to be going pretty much alphabetical.

If a particular pts is giving you trouble these two commands might help.

rmsf to get rid of it.

insf -e to put it back.

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
S.K. Chan
Honored Contributor

Re: Which pts is next?

Looking at your process list, someone initially logs in as root (pid 15011 with pts/tt) and then he switches user to ralph (pid 15012 ppid 15011) which in turn switches user to daniel (pid 16137 ppid 15451). That explains why the same pseudo-term. But I'm not sure about user bill. As far as the assignment of these pseudo-term goes .. it's in order starting with pts/0, pts/1, so on .., pts/tt depending on how may of these are defined.
John Poff
Honored Contributor

Re: Which pts is next?

Hi,

I agree with S.K., it looks like somebody did an 'su' to another user to start the other processes. That last process, if I'm reading your post correctly, shows a PPID of zero? That doesn't look right.

You can see all the processes on a single tty by using the '-t' option in 'ps'. It will save you having to grep for it:

ps -ft pts/tt


JP