procmail
[Top] [All Lists]

Re: Executing external cmds via procmail

2003-05-07 13:50:55
On Wed, May 07, 2003 at 03:59:27PM -0400, Paul Chvostek wrote:

On Wed, May 07, 2003 at 06:10:36PM +0200, Dallman Ross wrote:

No the lock file should go on the wrapper, because we don't know
if changing 'file' while 'program' is running will screw things
up.  (If we knew that 'program' could handle appends, we could do
it your way.)

If you put the lockfile before the open brace, how will procmail
know what to name it?  Perhaps a regional (global that is then
unset) lockfile is in order, then.

To quote the procmailrc(5) man page:

              :0 [flags] [ : [locallockfile] ]
              <zero or more conditions (one per line)>
              <exactly one action line>

So with:

  :0: /path/to/file.lock
  #whatever
  {
    :0 bwc
    /path/to/file

    :0
    | /path/to/program /path/to/file
  }

The lockfile is named "/path/to/file.lock", and execution of program is
protected by the lock.

Now, Paul . . . don't go and get pedantic on me. :-) I know about
naming lockfiles.  But you wrote back to the OP and just had a lonely
lockfile-colon up there with no lockfilename, and that's what I was
questioning.  :-)

I still am wondering if the flag doesn't accomplish the task here
to avoid a race.  (Frankly, I would have simply fed the body to
the program in the first place, and not bothered to save it first
to a file.)

        :0 Bwhi
        * ? program
        { some action, assuming program can take piped input and
          can put out a proper exit code }

-- 
dman



_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>