Re: sendmail starts before rpc.statd and rpc.lockd

From: Gregory Neil Shapiro <gshapiro_at_freebsd.org>
Date: Sun, 8 Jun 2003 19:45:02 -0700
> Generally, sendmail uses flock() on the aliases file and related databases
> to ensure consistency.  As far as I know, it's unrelated to redirection.

And for locking queue files.

> > Here is what Control-T does
> > load: 0.20  cmd: sendmail 292 [pause] 0.02u 0.04s 0% 2016k
> 
> pause, eh?  That doesn't sound like it's related the the NFS locking. 
> Note that the errors you get for sendmail due to lack of locking result in
> a fairly clean exit, not a hang.  Hangs are generally associated with DNS.
> Try a packet sniff?

No, it's sendmail:

void
queueup(e, announce, msync)
...
		const int flags = O_CREAT|O_WRONLY|O_EXCL|O_EXLOCK;
...
		/* get a locked tf file */
		for (i = 0; i < 128; i++)
		{
...
				tfd = open(tf, flags, QueueFileMode);
...
				if (lockfile(tfd, tf, NULL, LOCK_EX|LOCK_NB))
					break;
...
				(void) sleep(i % 32);
		}

While trying to create a locked queue file, it sleeps in case a later
attempt will work.
Received on Sun Jun 08 2003 - 17:45:04 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:11 UTC