Cannot spawn processes. Best way to shut down?

Posted by TheLinuxMailman@reddit | linuxadmin | View on Reddit | 8 comments

My Ubuntu 20.04 server is in an odd state. I cannot execute any command:

-bash: fork: retry: Resource temporarily unavailable

I can echo * (shell builtin) and see file names.

This is in a bash I previously ssh'd into, which has root. Ya, I'm one of those people who likes to keep root ssh open (sudo -i) for root commands I am frequently doing right now, in addition to ordinary user shells.

I am fairly certain I have free disk space on /.

Postfix is still running and receiving and storing mail, which I can see on my alpine on my logged-in user account shell. Both were running when this no-fork situation started.

What steps can I do next with my constrained situation before pressing reset? FS is ext4 on RAID1, so I don't expect anything worse from that than a RAID resync, maybe.

I guess I could disconnect the network and let the FS caches flush before rebooting. How long?

What can write I write to in /sys from the open shell that will shut down more gracefully and/or flush caches just before resetting?

Finally, any idea what is going on?