[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fetch process hangup watcher script ??

Stefan Stasik <sss@xxxxxxxxxx> wrote:

: one problem I have running leafnode on my Linux box at home is with my
: dynamic PPP dialup I use.  When ever fetch is retrieving groups, and my
: PPP connection goes down, the process hangs up and just sits there, and
: does not go away.  Well, sometimes it does seem to go away, other times
: it does not.  I wrote a simple shell script that checks for the lockfile
: when the process does NOT exist, and deletes the lock file so the next
: time my cron invokes fetch, fetch will run  (and not abort because the
: lock file exists).  That helped somewhat, but I still having trouble with
: when my PPP connection goes down, and then automatically redials  back up
: the fetch process can sit there for a couple of days, and no groups get
: downloaded.  

: I was thinking about writing a script that watches the fetch process to
: see if it is older than say 6 hours or 12 hours old, then just kill it,
: but it would be a bit involved, and... does anybody here have something
: like that written up already??? 

I've just started using leafnode, since v1.8.1.  This works pretty
well, especially since I have no desire to use any other news reader
than tin and this fills in nicely for tin's inability to work better
in an off-line mode.  

I noticed a similar difficulty with "hung" fetch processes.  My logic is
to simply look at the lock file, and determine if the PID in use is "live"
or not.  If the PID is not active, the lock file can safely be ignored
or removed.  If the PID is live, then I look to see if a PPP connection is
up or not.  If one is up, then I leave the running fetch process alone.
If PPP is down, then I figure that the running fetch is "hung" and it's
safe to kill it.  This works well for me since I use diald to dynamically
bring my PPP link up and down.  If fetch is hung and inactive for more
than 10 minutes, diald will automatically drop my PPP link down.

I also have noticed that fetch is not very fault tolerant.  I use leafnode
for something of a specialized purpose.  Basically to download articles
from alt.binaries.sounds.mp3.  The problem with fetch is that when it
gets interrupted, it completely wipes out the list of article bodies that
have been chosen for download when configured to run in delaybody mode.
An additional problem is that it also does not keep track of what headers
it has already acquired when it gets interrupted.  

I've written a Perl front-end for fetch and a very minor change
to nntpd that makes it much more fault tolerant at dealing with
interrupted connections.  Why Perl?  Because I don't program in C.
My Perl hack primarily deals with the loss of which bodies have been
downloaded by creating a backup of the various files that get put into
the interesting.groups directory.  I'd be glad to post my Perl hack if
anyone wants it.

 Michael |     mfaurot     | Agree with them now, it will save so much time.
 Faurot  | phzzzt.atww.org | 

leafnode-list@xxxxxxxxxxxxxxxxxxxxxxxxxxxx -- mailing list for leafnode
To unsubscribe, send mail with "unsubscribe" in the subject to the list