procmail
[Top] [All Lists]

formail & waiting of subprocesses (was Re: indications of a program failure?)

1996-05-31 12:35:33

-----BEGIN PGP SIGNED MESSAGE-----

From: dattier(_at_)wwa(_dot_)com (David W. Tamkin)
Date: Fri  May 31,  1:55pm

Robert Brown asked,

| How does procmail determine that a program has failed when using the "w"
| switch[?]

If the program terminates with non-zero exit status, procmail treats that as
a failure.

| So, I guess my question is:  when a program outputs stuff to stderr, does
| this indicate an error?

Not necessarily.

I'm glad someone replied.  I discovered that my problem was not an issue of
status returns, but rather that, for some strange reason (maybe due to NFS?),
/bin/rm doesn't happen fast enough to fail.

See, I have

x-command: /bin/rm foo

in one message.  This recipe

:0w
*^x-command:
|sh -c "`formail -x x-command`"

gets executed while another message (the same as above) gets received:

x-command: /bin/rm foo

then for some reason, both succeed!  This is even if I change the recipe to

:0w:x-command.lock
*^x-command:
|sh -c "`formail -x x-command`"

that is, I add a lockfile.  I put in a VERBOSE=on and it correctly locks and
unlocks the x-command.lock for each message, yet both /bin/rm's succeed.

So, I have given up and decided that it's not that important to find the
status, and just cross my finger that everything will always work...

- -- 
Internet: dummy(_at_)c2(_dot_)org                   In real life: Robert Brown,
URL: http://www.c2.org/~dummy                          in sunny Berkeley, CA
       >> Leonardo da Vinci didn't eat meat. <<        waiting for The Big One
    >> I'm pro-child and anti-birth, and I vote. <<    (510) 464-4604


-----BEGIN PGP SIGNATURE-----
Version: 2.6.2

iQB1AwUBMa9JSjZMMbnCKCB9AQG9MgL/aNYEDhM262wKgDCXP4+7aRbOUzkIb9aa
+H56CUoNUpBa0UCSaUBuG/i9cPA6dR+63H5x00Hqo9x+Rgts/CeVhKoDUlswCvDS
gkYumsf7jvX3AQTVm523PjER4g39hrSh
=9zNt
-----END PGP SIGNATURE-----

<Prev in Thread] Current Thread [Next in Thread>
  • formail & waiting of subprocesses (was Re: indications of a program failure?), Robert <=