OSError故障排除:pty设备

时间:2021-08-23 21:02:34

From time to time I'm getting an OSError exception with the message 'out of pty devices' when calling pty.openpty() (it's happening when a bunch of instances of my scripts run concurrently).

在调用pty.openpty()时,我会不时收到带有“out of pty devices”消息的OSError异常(当我的脚本的一堆实例同时运行时会发生这种情况)。

What is the limit that I'm hitting? How can I get around this?

我打的极限是多少?我怎么能绕过这个?

CentOS 5.6, Python 2.4

CentOS 5.6,Python 2.4

2 个解决方案

#1


10  

In my Ubuntu Linux, the max number of open ptys is given by:

在我的Ubuntu Linux中,打开的ptys的最大数量由下式给出:

cat /proc/sys/kernel/pty/max

This value is configurable in:

此值可在以下位置配置:

/etc/sysctl.conf

All this info, and much more can be found in:

所有这些信息,以及更多信息可以在:

man pty

#2


1  

Same issue is raised when devpts is not mounted, usually in chroots, to mount devpts device type:

如果未挂载devpts(通常是chroots)来挂载devpts设备类型,则会引发同样的问题:

# mount -t devpts none /path/to/chroot/dev/pts

#1


10  

In my Ubuntu Linux, the max number of open ptys is given by:

在我的Ubuntu Linux中,打开的ptys的最大数量由下式给出:

cat /proc/sys/kernel/pty/max

This value is configurable in:

此值可在以下位置配置:

/etc/sysctl.conf

All this info, and much more can be found in:

所有这些信息,以及更多信息可以在:

man pty

#2


1  

Same issue is raised when devpts is not mounted, usually in chroots, to mount devpts device type:

如果未挂载devpts(通常是chroots)来挂载devpts设备类型,则会引发同样的问题:

# mount -t devpts none /path/to/chroot/dev/pts