Gnus development mailing list
 help / color / mirror / Atom feed
From: Dan Christensen <jdc+news@uwo.ca>
Cc: ding@gnus.org
Subject: Re: Something fundamental - how nov works
Date: Sun, 25 Nov 2001 19:36:03 -0500	[thread overview]
Message-ID: <87elmmjrm4.fsf@uwo.ca> (raw)
In-Reply-To: <m1zo5au7hb.fsf@reader.newsguy.com> (Harry Putnam's message of "Sun, 25 Nov 2001 08:43:12 -0800")

Harry Putnam <reader@newsguy.com> 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



  reply	other threads:[~2001-11-26  0:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-25  3:40 Harry Putnam
2001-11-25  4:10 ` Karl Kleinpaste
2001-11-25  4:35   ` Harry Putnam
2001-11-25  6:20 ` Paul Jarc
2001-11-25 11:43 ` Simon Josefsson
2001-11-25 16:43   ` Harry Putnam
2001-11-26  0:36     ` Dan Christensen [this message]
2001-11-26  4:00       ` Harry Putnam
2001-11-27 23:11         ` Dan Christensen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87elmmjrm4.fsf@uwo.ca \
    --to=jdc+news@uwo.ca \
    --cc=ding@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).