充分利用终端的iTerm&QUOT奇怪的行为; -bash:叉:资源暂时不可用" [英] Getting strange behavior from terminal and iTerm "-bash: fork: Resource temporarily unavailable"

查看:97
本文介绍了充分利用终端的iTerm&QUOT奇怪的行为; -bash:叉:资源暂时不可用"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我打开的iTerm,我得到这个消息:

When I open iTerm, I'm getting this message:

最近一次登入:上周一ttys002 10月22日12时20分25秒
  结果-bash:叉:资源暂时不可用
  结果-bash-3.2 $

Last login: Mon Oct 22 12:20:25 on ttys002
-bash: fork: Resource temporarily unavailable
-bash-3.2$

和当我打开终端,我得到:

and when I open Terminal, I'm getting:

最近一次登入:上周一ttys002 10月22日12时25分47秒
  结果-bash:叉:资源暂时不可用
  结果威廉姆斯的MacBook-Pro的:〜$威廉

Last login: Mon Oct 22 12:25:47 on ttys002
-bash: fork: Resource temporarily unavailable
Williams-MacBook-Pro:~ william$

,每当我试图把一个命令,如LS或CD我收到此错误信息:

and whenever I try to put in a command, like ls or cd i get this error message:

-bash:叉:资源暂时不可用

-bash: fork: Resource temporarily unavailable

所以,我基本上什么都做不了。我试着在谷歌上搜索错误信息,而不是在任何地方获得。我与山狮在Mac上没有什么帮助。谢谢你。

So I basically can't do anything. I've tried googling the error message, but not getting anywhere. I'm on a Mac with Mountain Lion if that helps. Thanks.

编辑:

我跑了PS

获取进程的状态和我得到这个来自终端的响应:

to get the process status and i got this as a response from terminal:

威廉姆斯的MacBook-Pro的:〜$威廉PS
    结果PID TTY TIME CMD
    结果203 ttys000 0:00.08 -bash
    结果254 ttys001 0:00.03 bash的/Users/william/.rvm/scripts/wrapper红宝石1.9.3-P2
    结果553 ttys001 0:00.03 bash的/Users/william/.rvm/scripts/wrapper红宝石1.9.3-P2
    结果785 ttys001 0:00.03 bash的/Users/william/.rvm/scripts/wrapper红宝石1.9.3-P2
    结果814 ttys001 0:00.48 -bash
   结果1019 ttys001 0:00.03 bash的/Users/william/.rvm/scripts/wrapper红宝石1.9.3-P2

Williams-MacBook-Pro:~ william$ ps
PID TTY TIME CMD
203 ttys000 0:00.08 -bash
254 ttys001 0:00.03 bash /Users/william/.rvm/scripts/wrapper ruby-1.9.3-p2
553 ttys001 0:00.03 bash /Users/william/.rvm/scripts/wrapper ruby-1.9.3-p2
785 ttys001 0:00.03 bash /Users/william/.rvm/scripts/wrapper ruby-1.9.3-p2
814 ttys001 0:00.48 -bash
1019 ttys001 0:00.03 bash /Users/william/.rvm/scripts/wrapper ruby-1.9.3-p2

和消息

庆典/Users/william/.rvm/scripts/wrapper红宝石1.9.3-P2

bash /Users/william/.rvm/scripts/wrapper ruby-1.9.3-p2

保持在终端上市了几百倍(无法发布这一切导致它很可能不适合此框,它只是不断去一样),所以我猜有一些粗略的事情与文件。有谁知道如何解决这一问题?

keeps listing a few hundred times in the terminal (couldn't post it all cause it probably wouldn't fit into this box and it just keeps going the same), so I'm guessing there's something sketchy going on with that file. Does anyone know how to fix this?

推荐答案

庆典 - 和所有其他的壳,太 - 使用叉系统调用,以实际创建要从shell启动的进程。在这种情况下,庆典告诉您该系统调用结束资源暂时不可用,转换到<$ C 11 $ C>错误号价值,这是等于 EAGAIN

bash - and all the other shells, too - use the fork system call on Unix systems in order to actually create the process that you want to launch from the shell. In this case, bash tells you that the system call ended with Resource temporarily unavailable, which translates to the errno value of 11, which is equal to EAGAIN.

的手册页说,它可以设置错误号 EAGAIN 时:

The manual page for fork says that it may set errno to EAGAIN when :


  • 它无法分配足够的内存来复制母公司的页表和分配任务结构的孩子。

  • 这是不可能的,因为遇到来电者的 RLIMIT_NPROC 资源限制,以创建一个新的进程。超过此限制,进程必须具有的 CAP_SYS_ADMIN CAP_SYS_RESOURCE 的能力。

  • It cannot allocate sufficient memory to copy the parent's page tables and allocate a task structure for the child.
  • It was not possible to create a new process because the caller's RLIMIT_NPROC resource limit was encountered. To exceed this limit, the process must have either the CAP_SYS_ADMIN or the CAP_SYS_RESOURCE capability.

在这种情况下,我认为第一个原因并没有真正健全的现实,除非你是真正的内存不足,所以我猜你一定是刚打的限制正在运行的进程的用户的数量。

In this case, I think that the first reason doesn't really sound realistic, unless you are actually out of memory, so I guess you just must've hit the limit for the number of running processes for your user.

这篇关于充分利用终端的iTerm&QUOT奇怪的行为; -bash:叉:资源暂时不可用&QUOT;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆