From owner-freebsd-current@FreeBSD.ORG Sun Jun 8 19:45:04 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F2FC937B401; Sun, 8 Jun 2003 19:45:03 -0700 (PDT) Received: from horsey.gshapiro.net (horsey.gshapiro.net [64.105.95.154]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3BF1643FE1; Sun, 8 Jun 2003 19:45:03 -0700 (PDT) (envelope-from gshapiro@gshapiro.net) Received: from horsey.gshapiro.net (localhost [127.0.0.1]) h592j2hm017973 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 8 Jun 2003 19:45:02 -0700 (PDT) Received: (from gshapiro@localhost)h592j21u017972; Sun, 8 Jun 2003 19:45:02 -0700 (PDT) Date: Sun, 8 Jun 2003 19:45:02 -0700 From: Gregory Neil Shapiro To: Robert Watson Message-ID: <20030609024501.GP90892@horsey.gshapiro.net> References: <20030609011331.14200.qmail@web13507.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.4i cc: David Yeske cc: current@freebsd.org cc: net@freebsd.org Subject: Re: sendmail starts before rpc.statd and rpc.lockd X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jun 2003 02:45:04 -0000 > 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.