[Cialug] RH pty #s

David Champion dchamp1337 at gmail.com
Thu Jan 26 01:01:59 CST 2012


I thought /proc/sys/kernel/pty/nr should show the number of pts currently
in use, which is what the man page for proc says:

http://linux.die.net/man/5/proc

I looked around, and it seems there is a kernel bug that is not decreasing
nr when a pty terminates:

https://lkml.org/lkml/2009/11/5/401

Some users have reported problems where they can't log in, because the
system things there are no more pts left because nr is reporting as larger
than max.

If this were working correctly, nr would give you the current number of
users, but will increment for each pty you have open in a screen session,
for instance.

-dc

On Wed, Jan 25, 2012 at 10:43 PM, Zachary Kotlarek <zach at kotlarek.com>wrote:

>
> On Jan 25, 2012, at 4:13 PM, L. V. Lammert wrote:
>
> > I tested on SuSE 11.4 and the next login session received the next
> *available* pty
>
>
> That's what you should see on modern linux kernels; AFAIK there are no
> userland options to override that behavior. But I couldn't tell you what
> constitutes modern other than "2.6.33.2 or later", as that's the oldest
> kernel I have available for easy testing.
>
> I'm also not positive a PTY close is atomic with respect to the same PTY
> becoming available for reuse, though I suspect it is, or that it's so close
> that it's hard to trigger other behavior.
>
>        Zach
>
>
> _______________________________________________
> Cialug mailing list
> Cialug at cialug.org
> http://cialug.org/mailman/listinfo/cialug
>
>


More information about the Cialug mailing list