[Cialug] RH pty #s

Zachary Kotlarek zach at kotlarek.com
Thu Jan 26 02:00:35 CST 2012


On Jan 25, 2012, at 11:01 PM, David Champion wrote:

> 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:
> 
> I looked around, and it seems there is a kernel bug that is not decreasing
> nr when a pty terminates:


Yeah, broken from 2.6.28 to at least 3.2.0. It may be fixed in 3.3 or a later 3.2.x -- there have been a couple of patch submissions but I'm not sure if anything has stuck yet.


> 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.


I can't reproduce that, at least not on 2.6.33.2 or later -- in my testing the limit from max is correctly enforced even though nr is wrong.

On modern kernels the PTY limit is adjustable dynamically, so if you do run out of PTYs for whatever reason you can just echo a bigger number into /proc/sys/kernel/pty/max

	Zach

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2746 bytes
Desc: not available
URL: <http://cialug.org/pipermail/cialug/attachments/20120126/75953a35/attachment-0001.bin>


More information about the Cialug mailing list