Linux ssh bash fork retry: no child processes

Viewed 65938

I am on arch linux, accessing an account on a server over SSH. I have run a bash script containing recursion that results in an infinite loop of "no such file or directory" which continues despite any interrupt command ctrl C etc, it is totally uninterruptible. This eventually results in an endless stream of bash: fork: No child processes. I cannot execute any commands whilst this happens, and when it stops with "Resource temporarily unavailable", i am unable to execute any commands to kill the script because "bash: fork: No child processes" starts up again. I have no idea what to do, any help?

ps doesn't work

4 Answers

Looks like you've caused a fork bomb. You can try the methods here to stop it, but you'll most likely end up needing to reboot.

Run kill -9 -1 from the user login that caused the forkbomb . No need to reboot. PS: Consult your seniors before running it on Prod server

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

Run ps faux (you might need to run it from other user or with sudo) and search for the offending process (may look like a big branch of the tree)

If needed, kill the process via its PID

Related