procmail
[Top] [All Lists]

Re: locking a script

2000-12-23 13:14:52
Eric has this code,

| :0w
| *^Subject:.*wait
| | perl /home/eric/bin/wait.pl

where wait.pl creates a file and sleeps thirty seconds.  He wondered,

| All the files had the same mod time from 10 executions truggered by 10
| concurrent emails.
| 
| Why is the 'w' doing nothing?

`w' is doing plenty: it's telling each procmail to wait for its own perl
child to finish.  It's not telling procmail to wait for any other procmail's
perl child to finish.

Try this:

 :0w:wait.lock
 * ^Subject:.*wait
 | perl /home/eric/bin/wait.pl

There `w' should tell procmail not just to wait but also to keep the local
lockfile until perl has exited (without `w' procmail would wait to get the
lockfile but would release it as soon as perl accepted the input).  Since
only one procmail instantiation can have the lockfile at a time, it should
take five minutes for all ten concurrent deliveries to finish.

_______________________________________________
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>