I have the great -bash: fork: Cannot allocate memory error.

Normall I would reboot. But that is not an option. Using only SSH can you imagine some trick I can use? /sbin/shutdown -r now gives the error. ls gives the error. ps gives the error.

I think there is nothing to do. But why not ask?

  • Rather than implicitly fork a subshell to execute a command in you can substitute your current shell and use exec to replace the shell with 1 different command – HBruijn Dec 11 '18 at 8:53
  • Tried that. No luck. Actually I am locked out of SSH now so that is the end. But these are good suggestions! – stone.212 Dec 11 '18 at 9:49

You can try to reboot your server the magic way. First, you must activate the magic SysRq option (if not already activated)

# echo 1 > /proc/sys/kernel/sysrq

When you are ready to reboot the machine simply run the following:

# echo b > /proc/sysrq-trigger
  • I tried that. 'echo' kicks me out of the shell. Good idea though! (And useful for other people with similar problems. – stone.212 Dec 11 '18 at 9:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.