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

Re: fetchmail: removing stale lockfile



On Mon, May 22, 2000 at 07:04:05PM -0400, Chris Gray wrote:
> On Mon, May 22, 2000 at 09:47:01AM -0700, kmself@ix.netcom.com wrote:
> > On Mon, May 22, 2000 at 01:55:26PM +0200, Oswald Buddenhagen wrote:
> > > On Mon, 22 May 2000 kmself@ix.netcom.com wrote:
> > > 
> > > > I'm getting the message:
> > > > 
> > > >     fetchmail: removing stale lockfile
> > > > 
> > > > ...every time I run fetchmail (5.3.4-1) on my system.  I just checked
> > > > and I'm running the most current version.
> > > > 
> > > > Running strace, I find the following:
> > > > 
> > > >     open("/home/karsten/.fetchmail.pid", O_RDONLY) = 3
> > > >     [...]
> > > >     unlink("/home/karsten/.fetchmail.pid")  = -1 ENOENT (No such file or
> > > > 
> > > > Naturally, ~/.fetchmail.pid does not exist.
> > > > 
> > > as you can see from the above two lines i cut out, the file seems to
> > > disappear while it is read ...
> > > this typically would indicate some race condition.
> > > is it possible, that there are two instances of fetchmail started by the
> > > cron job at nearly the same time?
> > > 
> > > i have no other idea ...
> > 
> > The strace results come from launching fetchmail from the command line.
> > AFAICT, only one instance is running.
> 
> Reading the source, we see that if fetchmail is unable to kill its own
> process with signal 0 (i.e. no signal), then it gives you this gripe.
> 
> Now why would this happen?  Either the pid has changed from when it was
> put into the lockfile, fetchmail has stopped altogether, or the
> .fetchmail.pid file does not exist.  The last option is not the case,
> since fetchmail checks to see if it gets NULL.  I don't know how the
> first would happen, so I'm going to guess that somehow fetchmail gets
> stopped without cleaning up after itself.  Maybe you use 'kill -9' on it
> either explicitly or in a script.  I think this could also happen if you
> reboot a lot.
> 
> Of course, I could have just read the strace a little better and I would
> have seen all that a lot earlier.

FWIW, the problem appears to have spontaneously vanished in much the
same fashion as it first spontaneously appeared.  Go figah.

-- 
Karsten M. Self <kmself@ix.netcom.com>         http://www.netcom.com/~kmself
  What part of "Gestalt" don't you understand?       Debian GNU/Linux rocks!
    http://gestalt-system.sourceforge.net/    Rusty? http://www.kuro5hin.org
GPG fingerprint: F932 8B25 5FDD 2528 D595  DC61 3847 889F 55F2 B9B0

Attachment: pgp_gyJ7mdl91.pgp
Description: PGP signature


Reply to: