diff options
author | silby <silby@FreeBSD.org> | 2003-06-19 05:57:25 +0000 |
---|---|---|
committer | silby <silby@FreeBSD.org> | 2003-06-19 05:57:25 +0000 |
commit | 79bbff7ee281598d9786154de618cf81045b74ad (patch) | |
tree | af9412045d28b5df631f204b58de3ce10ee975e4 | |
parent | 9e70570ef3d1660662b5f58378faa263f2af991e (diff) | |
download | FreeBSD-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
-rw-r--r-- | sys/kern/kern_fork.c | 6 |
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) { |