summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_fork.c
diff options
context:
space:
mode:
authorsilby <silby@FreeBSD.org>2003-06-19 05:57:25 +0000
committersilby <silby@FreeBSD.org>2003-06-19 05:57:25 +0000
commit79bbff7ee281598d9786154de618cf81045b74ad (patch)
treeaf9412045d28b5df631f204b58de3ce10ee975e4 /sys/kern/kern_fork.c
parent9e70570ef3d1660662b5f58378faa263f2af991e (diff)
downloadFreeBSD-src-79bbff7ee281598d9786154de618cf81045b74ad.zip
FreeBSD-src-79bbff7ee281598d9786154de618cf81045b74ad.tar.gz
Add a ratelimited message of the form
"maxproc limit exceeded by uid %i, please see tuning(7) and login.conf(5)." Which will be triggered whenever a user hits his/her maxproc limit or the systemwide maxproc limit is reached. MFC after: 1 week
Diffstat (limited to 'sys/kern/kern_fork.c')
-rw-r--r--sys/kern/kern_fork.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c
index 4045feb..226a42c 100644
--- a/sys/kern/kern_fork.c
+++ b/sys/kern/kern_fork.c
@@ -202,7 +202,8 @@ fork1(td, flags, pages, procp)
struct proc *newproc;
int trypid;
int ok;
- static int pidchecked = 0;
+ static int curfail, pidchecked = 0;
+ static struct timeval lastfail;
struct filedesc *fd;
struct filedesc_to_leader *fdtol;
struct proc *p1 = td->td_proc;
@@ -730,6 +731,9 @@ again:
*procp = p2;
return (0);
fail:
+ if (ppsratecheck(&lastfail, &curfail, 1))
+ printf("maxproc limit exceeded by uid %i, please see tuning(7) and login.conf(5).\n",
+ uid);
sx_xunlock(&allproc_lock);
uma_zfree(proc_zone, newproc);
if (p1->p_flag & P_SA) {
OpenPOWER on IntegriCloud