OSError 故障排除:pty 设备不足

发布于 2024-12-22 00:53:32 字数 168 浏览 3 评论 0原文

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

我达到的极限是什么?我该如何解决这个问题?

CentOS 5.6、Python 2.4

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

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

CentOS 5.6, Python 2.4

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

苦妄 2024-12-29 00:53:32

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

cat /proc/sys/kernel/pty/max

该值可在以下位置配置:

/etc/sysctl.conf

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

man pty

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

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
哭了丶谁疼 2024-12-29 00:53:32

当未安装 devpts 时(通常在 chroots 中)来安装 devpts 设备类型,也会出现同样的问题:

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

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

mount -t devpts none /path/to/chroot/dev/pts
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文