Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 23 Nov 2002 13:37:00 -0600
From:      Dan Nelson <dnelson@allantgroup.com>
To:        Doug Lee <dgl@dlee.org>
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>
In-Reply-To: <20021123185018.GJ55241@kirk.dlee.org>
References:  <20021123185018.GJ55241@kirk.dlee.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021123193700.GB4795>