[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: OT: Courier MTA: fork: Resource temporarily unvailable

Scott Wells <scott_(_at_)_shadowsystems_(_dot_)_tzo_(_dot_)_com> sent:
> Date: Tue, 17 Dec 2002 00:35:20 -0600
> From: Scott Wells <scott_(_at_)_shadowsystems_(_dot_)_tzo_(_dot_)_com>
> To: misc_(_at_)_openbsd_(_dot_)_org
> Subject: OT: Courier MTA: fork: Resource temporarily unvailable
> I need some help.  I'm trying to install Courier MTA, and am getting the 
> following while running make check:
> Making check in waitlib
> make[1]: Entering directory `/tmp/courier-0.40.1/waitlib'
> ./testwait
> fork: Resource temporarily unavailable
> fork: Resource temporarily unavailable
> ...
> This is while running as the user courier.  Doesn't happen when I run as 
> root.  Makes me think I should increase the number of processes per 
> non-root user?  If that's correct, can anyone point me to the place to 
> make that adjustment?  I've looked through the kernel config files, and 
> didn't see anything particular applicable.  I see there's a few sysctl 
> parameters dealing with forking, but the man page says nothing about 
> them.  FYI...
> root_(_at_)_srv5 /etc: sysctl kern.maxproc
> kern.maxproc = 532
> root_(_at_)_srv5 /etc: sysctl kern.nprocs 
> kern.nprocs = 31
> Or tell me if I'm wrong altogether...
> Thanks,
> Scott

Most unix systems have a "user process" limit, but the method
of enforcement varies.  When in doubt, consult the source.  Doing
this in OpenBSD, /usr/src/sys/kern/kern_fork.c has this at about line 177:

        if (uid != 0 && count > p1->p_rlimit[RLIMIT_NPROC].rlim_cur) {
                (void)chgproccnt(uid, -1);
                return (EAGAIN);
this is probably the error you hit,
	% egrep EAGAIN /usr/include/sys/errno.h
	#define EAGAIN          35              /* Resource temporarily unavailable */

Checking limits as a regular user:

	% limit
	cputime         unlimited
	filesize        unlimited
	datasize        65536 kbytes
	stacksize       4096 kbytes
	coredumpsize    unlimited
	memoryuse       173592 kbytes
	memorylocked    57864 kbytes
--->	maxproc         64 
	openfiles       64 

At a guess, your system may have a smaller value here.

login.conf has stuff to set the limits value for interactive users,
which is where the 64 above came from.  I'm not sure how this would
affect courier.  Look into how it runs and see how you can alter how
this is set.

But wait, this is happening when you *build* the thing?  Um -- is it
important if "./testwait" works as user courier?  What is that doing
anyways?  Does courier really need to fork off >64 processes?
Does it have any sort of notion of load management itself or
when and how do you want it to fail if it should try to fork
too many things?

						-Marcus Watts

Visit your host, monkey.org