The reason why I put the lock on "badguys" is so that you can use the
following procedure to safely update the file without possibly causing
the fgrep perform falsely:
rm -f badguys.lock
Is there a similar way to protect .procmailrc itself while editing it?
I usually edit ".newprocmailrc" and then hope a "mv" doesn't cause
trouble. But sometimes I'm lazy :-) And I don't trust mv to
guarantee that one or the other of the old/new files will be found,
especially over NFS.
In fact, would badguys.lock even work over NFS? (Most general
case would be MDA on one machine, the lockfile on a second, and
the user on a third, all separated by NFS interfaces, I guess.)
BTW, I'd recommend the "addbadguy" script Alan suggested rather than
the three-liner quoted above, because the latter could leave the
thing locked for hours if you get distracted while editing.
Stan Ryckman (stanr(_at_)tiac(_dot_)net)