【问题标题】:Linux ssh bash fork retry: no child processesLinux ssh bash fork 重试:没有子进程
【发布时间】:2018-04-18 23:29:42
【问题描述】:

我在 Arch linux 上,通过 SSH 访问服务器上的帐户。我已经运行了一个包含递归的 bash 脚本,它导致“没有这样的文件或目录”的无限循环,尽管有任何中断命令 ctrl C 等,它仍然会继续,它是完全不可中断的。这最终导致无休止的 bash: fork: No child processes。发生这种情况时我无法执行任何命令,并且当它以“资源暂时不可用”停止时,我无法执行任何命令来终止脚本,因为“bash:fork:No child processes”再次启动。我不知道该怎么办,有什么帮助吗?

ps doesn't work

【问题讨论】:

  • 好吧,没有什么具体的东西可看,也没有实验,很难提供帮助......
  • 找到并终止启动所有分叉的脚本。 ps aux | grep myprogram && kill <pid of myprogram>
  • ps 不起作用
  • 不知道怎么办,只有kill有效,所以我需要PID,ps无效,pkill也不行
  • 另外,您可以尝试将ps 运行为sudo

标签: linux bash shell ssh sh


【解决方案1】:

看起来你引起了fork bomb。您可以尝试here 的方法来阻止它,但您很可能最终需要重新启动。

【讨论】:

  • 这是来自redhat access.redhat.com/solutions/543503的解决方案
  • 我能够通过使用 systemctl 来停止一些服务并为我争取时间运行 ps 以找到罪魁祸首来避免重新启动......一个逃跑的 cronjob
【解决方案2】:

从导致 forkbomb 的用户登录中运行 kill -9 -1。无需重新启动。 PS:在 Prod 服务器上运行之前咨询你的前辈

【讨论】:

  • 这对我的托管有帮助
【解决方案3】:
1) ps faux  (find PID and place in second command)
2) kill [PID]


If any virus attack then again this process come so you need to enable virus scanner on cpanel and scan and remove.

Important:
Hosting providers must install the following services for this interface to appear:

The ClamAV Scanner plugin in WHM’s Manage Plugins interface (WHM >> Home >> cPanel >> Manage Plugins).
The Exim Mail Server service on the server in WHM’s Service Manager interface (WHM >> Home >> Service Configuration >> Service Manager).

【讨论】:

    【解决方案4】:

    运行ps faux(您可能需要从其他用户或sudo 运行它)并搜索有问题的进程(可能看起来像树的一个大分支)

    如果需要,通过它的 PID 杀死进程

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-01-12
      • 1970-01-01
      • 1970-01-01
      • 2017-03-04
      • 2021-04-28
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多