procmail
[Top] [All Lists]

Re: locking the logfile -- how to?

1997-08-23 12:35:45
Timothy Luoma asked,

| someone mentioned locking the procmail log file, so it won't be overwritten  
| -- or rather, _inter_written.
| 
| How is this done? (use small words, please, it's been a long week).

There's always the meat-axe approach: a global lockfile for your entire
.procmailrc.

Since I make very little use of the LOG variable and nearly every write
to my logfile comes as the logabstract of final delivery or the output of
the TRAP statement's command, most incoming messages make only one write
to my logfile, and I see very little intermixing.  Occasionally it used to
happen on the logabstracts of c-flag recipes back in the olden days when
LOGABSTRACT=all meant something (and frankly, I'll gladly take back the
infrequent intermixing in order to have copy-delivering recipes logged again).

Another thing that gave rise to it was spawning clones; that's the reason
I took to putting W or w flags on recipes that launch clones.

Timothy wrote later, regarding W. Wesley Groleau's suggestion to prevent
intermixing by using a separate logfile for each message:

| I could do this, but I want to keep the log all in one for a very simple  
| reason:  I have an application which pops up whenever something is added to  
| the log (ie a new message is filed).  After 30 seconds, it goes away again.

| Very handy.
| Too handy to lose.

Can't you teach it to look for the appearance of a new file in the logfile
directory and to pop up for that?

Personally, I can't use Wesley's suggestion because of disk quota restric-
tions.  But if you own your own hardware and have the space, that's not a
problem for you.