| > An interview question for a position that requires knowledge of bash/linux/stuff could be: > What if you're ssh'd into a machine, you're in your trusty bash shell, but unfortunately you cannot spawn any new processes because literally all other pids are taken. What do you do? I'd look in the /proc/[pid]/ filesystem for visibility into what processes are exhausting the PID space. `kill` is a shell builtin in bash, you don't have to rely on forking a new process like /bin/kill. If you can find out the parent process whose children are exhausting PIDs you're well on your way to stopping it and getting a handle on things again. And I'll be darned, this script parses /proc. No | pipes or $( .. ) substitutions that would need to spawn another bash subshell process either. Pretty clean. |
This went over quite well.