procmail
[Top] [All Lists]

Re: varname=| construct broken?

2004-02-21 11:38:58
On Sat, Feb 21, 2004 at 11:05:28AM -0700, Ian D. wrote:

Alright, I have a new problem.  This is using v3.23pre provided by
Bart.  The rc file is as follows:

-----
SHELL=/bin/sh
:0:/tmp/jjj
RESULTS=|/tmp/error
LOG="$RESULTS
"
-----
/tmp/error is a script that returns non-zero:
#! /bin/sh
echo "this is stdout"
/bin/false
-----
Yes, this particular program is useless but demonstrates the issue I have.
I only want one instance to run at once (too many bring my system
to its knees, I have found out.)  Hence, the need for locking.  Therefore,
I can't just say RESULTS=`/tmp/error`, I want to use a recipe to 
leverage locking.

When you run procmail </dev/null, you get no output.  

I can remove the lock file from the recipe and this works, but I need 
the lock file.  The problem also only seems to be when the program
invoked returns non-zero.

These assignment recipes seem really squirrelly to me.  I guess I will
have to write to a file and get the output from there.  Yuck.

I'm not entirely sure I understand all you wanted to explain.  However,
it sounds to me like you might want to be invoking global locking rather
than local.  From "man procmailrc":

       LOCKFILE    Global  semaphore  file.  If this file already
                   exists, procmail will wait until it  has  gone
                   before  proceeding,  and will create it itself
                   (cleaning it up when ready,  of  course).   If
                   more than one lockfile are specified, then the
                   previous one will be removed before trying  to
                   create the new one.  The use of a global lock­
                   file is  discouraged,  whenever  possible  use
                   locallockfiles   (on   a   per  recipe  basis)
                   instead.


It doesn't actually ahve to be global.  It can be "regional," as
David Tamkin from this list usefully has named it in the past.

Also, if running a few instances of procmail bogs your system down that
markedly, something else is going on.  Procmail is damn lightweight!  If
you are running lots of forks and pipes, though . . . .

-- 
dman (top-posting discouraged on this list)

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