Subject: Re: Unable to open terminals in X
To: Ian P. Thomas Ipt <ipthomas_77@yahoo.com>
From: Steven M. Bellovin <smb@research.att.com>
List: netbsd-users
Date: 12/20/2001 20:51:03
In message <20011220195310.A305@solo.scraemondaemon.org>, "Ian P. Thomas Ipt" w
rites:

>	Mine also have the same permissions.  I was able to get an error
>message from trying to execute xterm: 
>
>xterm:no available ptys: no such file or directory
>
>	I know this isn't true.  I have ptys listed in /etc/ttys and in /dev.
>Do I need to add anything to /etc/ttys?  Here is what my ptys look like in
>there:
>
>ttyp0 	none	network
>
>	The rest under it are identical.  The tty that X comes up on is listed
>as follows:

I don't think that the ttys entry matters.  But the error message from 
xterm is misleading to the point of uselessness.  xterm (probably) 
calls openpty, or does the same thing manually.  The "same thing" is 
"loop through all possible pty masters until an open succeeds".  If an 
open attempt fails, it checks to see if the cause is ENOENT, which 
would indicate that the machine is all out of configured ptys.  The 
real question is why it can't open any.

You could -- from a console prompt -- try something like

	sleep 5 </dev/ptyp0

and see how it fails.  If it succeeds, it points the finger of blame at 
X, rather than the system.  If it fails, the exact error message is 
likely to be much more useful than the one you're seeing.  If it 
succeeds, try running the 'script' command, since that uses ptys and 
wasn't touched by your upgrade.  Another possibility is to run 'script' 
under 'ktrace'.  Doing the same with xterm would be even better, but 
perhaps infeasible.

It could, of course, be something as simple as a missing (for some 
reason) ptyp0 entry in /dev, at which point it would give up.  But 
let's try to localize the problem.

		--Steve Bellovin, http://www.research.att.com/~smb
		Full text of "Firewalls" book now at http://www.wilyhacker.com