Wednesday, December 26, 2012

how to prevent fork bomb

One way is to limit the maximum number of processes that a single user may own or system may allow.

On FreeBSD, this can be achieved by configuring kernel parameters: kern.maxprocperuid and/or kern.maxproc. It can be done by:
  1. set  respective limit in /boot/loader.conf (or, /etc/login.conf), or
  2. configure dynamically through command sysctl
On Linux, it can be done by configuring the parameter: max. number of processes (nproc), which is in /etc/security/limits.conf.


No comments:

Post a Comment