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

Re: [leafnode-list] Cannot obtain lock file, aborting.



On Thu, 14 Nov 2002, Nicolas wrote:

> Le Jeudi 14 Novembre 2002 20:58, vous avez écrit :
> > On Thu, 14 Nov 2002, Nicolas wrote:
> > > Le Jeudi 14 Novembre 2002 20:27, vous avez écrit :
> > > > Nicolas <oxstone@xxxxxxx>:
> > > >
> > > > also, leafnode drops priviledges.  what do you mean by "both users
> > > > root and news"?
> > >
> > > I mean news are fetched by the user "news". It's in its crontab. I tried
> > > to fetch news using the root user too, but that made no difference.. =(
> >
> > This may be redundant, but have you tried simply re-booting?  Not long
> > ago, I had process that would NOT die, and others that would die but not
> > completly - they would not release all their resources, including
> > file-locks.  Very bizarre.
> >
> > NOTHING short of a re-boot could make it right again.  Eventually found it
> > was being caused by ONE bad secton on a HD, that just happened to be in a
> > meta-data area and so was affecting a lot of processes and files.
> >
> > Just another Shot In The Dark, and of course YMMV.
> >
> > Michael O'Quinn
> 
> Well, I reboot 4 days ago, there should not be any problem I think. The 
> harddrive is a recent Maxtor which runs perfectly. BUT, you talked about a 
> process that would not die. To check this, I typed:
> #ps -ef | grep fetch
> Which gave the following result:
> news      4832  4828  0 Nov12 ?        00:00:00 /usr/local/sbin/fetchnews
> 
> I think there's a problem here!
> But what can I do? I could, of course, kill this process. But I don't plan to 
> kill that process each day! I would like leafnode to run smoothly without 
> having to kill it!!! Any idea?

Well now, that's a different matter.  I would try gently killing that
process first "kill -HUP 4832".  If that doesn't work then chop off it's
head "kill -9 4832"  If THAT doesn't kill it, something's likely wrong
with your system.

FWIW, I have a full time DSL connection.  I run fetchnews every hour, to
be reasonably responsive to new group subscriptions.  OTOH, sometimes
fetchnews runs for 6 or 12 hours.  As a result I get lots of those "Cannot
obtain lockfile" messages, but I know it's O.K. because there actually IS
a real fetchnews already running.

There are two problems with this, however.

First, I like to run texpire each day in the wee hours of the morning, but
it can't run if fetchnews is running.

Second, occasionally my upstream server would hiccup, and leave fetchnews
in an indeterminate state, and it would not die on it's own.  Only killing
it would release the lock file.

I have cron jobs setup to (a) stop the hourly fetchnews attempts about an
hour and a half before texpire is scheduled to run, (b) wait that hour and
a half, (c) gently stop fetchnews (in case it's still running...)  
"killall -HUP fetchnews", (d) wait 20 seconds, (e) violently kill
fetchnews again in case the first attempt failed "killall -9 fetchnews",
and (f) run texpire.  Roughly 45 minutes later the hourly fetchnews
attempts start up again.

The daily killall's (1) make sure texpire is able to run, and (2) are a
crude way to stop the bleeding when the upstream server bobbles fetchnews.

Except for the hard-drive problem mentioned above, I've never gotten the
lockfile error in error; I.E. it always turned out that there WAS a
fetchnews running (or at least still TRYING to run...)

Here's my cron file...

# Suck up some news on occasion.
51 0-1,4-23 * * * news /usr/local/sbin/fetchnews -nvv
02 4        * * * news /usr/local/sbin/killfetchnews
04 4        * * * news /usr/local/sbin/texpire -fvv

And here's /usr/local/sbin/killfetchnews...

#!/bin/bash

echo "Killing fetchnews..."
/usr/bin/killall    fetchnews
sleep 20
echo "Killing fetchnews with Signal -9"
/usr/bin/killall -9 fetchnews
echo "Done"

Probably not what you wanted to hear, but it's how I solved a couple of
sticky problems.  Since settling on this setup, I've had zero problems
except for that hard drive failure.

Michael O'Quinn




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