3

Let's say you have a process that forks every time it has the chance. It launches itself in niceness -20, so it forks faster than you can kill it.

Also, it remembers its childrens and it parents, so it can wake them up if you SIG_STOP them.

You have an ssh terminal open with a bash. But you can't launch new process, since all the pid are taken.

You also have no physical access to the computer.

How would you kill them and take back the control of your system? Rebooting would be a last-resort option.

Bonus question: after you've fixed the problem, how would you prevent that to happen again?

  • 1
    A forkbomb is one such thing you're talking about. There are many articles online talking about preventative measures. – wulfgarpro Jun 22 '16 at 10:19
  • It's more about disarming one after it's being launched. – blue112 Jun 22 '16 at 12:02
  • 1
    Limiting the damage in the future is the easy part. In a server dedicated to Linux lessons (e.g. used by students), I have an watchdog and a limit of processes per user. Either a user hits the limit of processes, and then a teacher has to login and kill all their processes, or if they manage to seriously impair performance, the server reboots alone. The utmost importance on this server is minimising downtime and especially admin intervention. There are more sophisticated always of limiting performance, for us the current configuration has been working pretty well. – Rui F Ribeiro Jun 22 '16 at 13:31

Your Answer

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

Browse other questions tagged or ask your own question.