From owner-freebsd-questions Sat Nov 23 11:37:13 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EBC2237B401 for ; Sat, 23 Nov 2002 11:37:11 -0800 (PST) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id DC98743EF2 for ; Sat, 23 Nov 2002 11:37:07 -0800 (PST) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.12.6/8.12.6) id gANJb0GK002161; Sat, 23 Nov 2002 13:37:00 -0600 (CST) (envelope-from dan) Date: Sat, 23 Nov 2002 13:37:00 -0600 From: Dan Nelson To: Doug Lee Cc: freebsd-questions@FreeBSD.ORG Subject: Re: Is this a good time for a procmail global lock file? Message-ID: <20021123193700.GB4795@dan.emsphone.com> References: <20021123185018.GJ55241@kirk.dlee.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20021123185018.GJ55241@kirk.dlee.org> X-OS: FreeBSD 5.0-CURRENT X-message-flag: Outlook Error User-Agent: Mutt/1.5.1i Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In the last episode (Nov 23), Doug Lee said: > procmailrc(5) advises us to use per-recipe local lock files instead > of using the LOCKFILE environment variable to set up a global one. I > use LOGFILE to log abstracts for deliveries though, and at busy > moments, these abstracts are getting intermingled, making it > impossible for scripts to process them accurately. > > Is there a better way to prevent this than using the evil global lock > file? It's likely that procmail does not lock LOGFILE, and from looking at the source it writes the abstract with a huge number of separate write() calls. You're probably stuck with using a global lockfile, which should force serial access to procmail. If you only have one rule in your procmailrc, it's no worse than a local lockfile. If you've got a bunch, you might need to log the abstracts manually with a single write call (or rewrite procmail's logging functions). A call to /usr/bin/printf with the appropriate format string should work. -- Dan Nelson dnelson@allantgroup.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message