From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/40526 Path: main.gmane.org!not-for-mail From: Dan Christensen Newsgroups: gmane.emacs.gnus.general Subject: Re: Something fundamental - how nov works Date: Sun, 25 Nov 2001 19:36:03 -0500 Sender: owner-ding@hpc.uh.edu Message-ID: <87elmmjrm4.fsf@uwo.ca> References: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1035176062 1388 80.91.224.250 (21 Oct 2002 04:54:22 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 04:54:22 +0000 (UTC) Cc: ding@gnus.org Return-Path: Original-Received: (qmail 18125 invoked from network); 26 Nov 2001 00:37:27 -0000 Original-Received: from malifon.math.uh.edu (mail@129.7.128.13) by mastaler.com with SMTP; 26 Nov 2001 00:37:27 -0000 Original-Received: from sina.hpc.uh.edu ([129.7.128.10] ident=lists) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1689l6-000787-00; Sun, 25 Nov 2001 18:36:28 -0600 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Sun, 25 Nov 2001 18:36:12 -0600 (CST) Original-Received: from sclp3.sclp.com (qmailr@sclp3.sclp.com [209.196.61.66]) by sina.hpc.uh.edu (8.9.3/8.9.3) with SMTP id SAA17237 for ; Sun, 25 Nov 2001 18:35:59 -0600 (CST) Original-Received: (qmail 18106 invoked by alias); 26 Nov 2001 00:36:09 -0000 Original-Received: (qmail 18101 invoked from network); 26 Nov 2001 00:36:09 -0000 Original-Received: from pony.its.uwo.ca (129.100.2.63) by gnus.org with SMTP; 26 Nov 2001 00:36:09 -0000 Original-Received: from pony.its.uwo.ca (hurdle.its.uwo.ca [129.100.2.108]) by pony.its.uwo.ca (8.12.1/8.12.0) with ESMTP id fAQ0aY0v026254 for ; Sun, 25 Nov 2001 19:36:34 -0500 (EST) Original-Received: from scratchy (ren.math.uwo.ca [129.100.75.76]) by pony.its.uwo.ca (8.12.1/8.12.0) with ESMTP id fAQ0aXao026239; Sun, 25 Nov 2001 19:36:33 -0500 (EST) Original-Received: from jdc by scratchy with local (Exim 3.32 #1 (Debian)) id 1689kh-0005Cc-00; Sun, 25 Nov 2001 19:36:03 -0500 Original-To: Harry Putnam Mail-Copies-To: never In-Reply-To: (Harry Putnam's message of "Sun, 25 Nov 2001 08:43:12 -0800") Original-Lines: 47 User-Agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/21.1 (i386-debian-linux-gnu) Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:40526 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:40526 Harry Putnam writes: > By writing the data in mbox format to a spool where gnus thinks it is > procmail output, slurps it and writes it to the nnml group. That's what you should do. > A problem I considered there is the event where my script is writing > to the procmail like spool when gnus is slurping. I guess that is > where locking of some kind comes up. Right. > [...] > lockfile ~/spool/todo.in.lock > ..[ script action part]... > rm -f ~/spool/todo.in.lock > [...] This is correct, except that maybe you should check whether lockfile succeeds. (It could be killed while waiting.) For example: if ! lockfile ~/spool/todo.in.lock then echo "Unable to lock todo.in." exit 13 fi You might also want to specify something like "-r3" on the lockfile line so that it just tries a few times and then gives up. > Looks like what the man page suggests but by commenting out the rm -f > so the lock stays on for testing, I find I can access that file at > will from the command line, write to it with echo or whatever, so > apparently it isn't being locked at all. All that "locked" means is that future calls to lockfile will wait until the lock file is removed. In one window, type "lockfile foo". In another, type "lockfile foo". This will wait. In the first window, type "rm -f foo" and you will see the second lockfile return. The idea is that all programs that access the file xxx first run lockfile on xxx.lock. -- Dan Christensen jdc+news@uwo.ca