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

Re: [leafnode-list] could not hand over lockfile to child



Jan Knutar schrieb am Samstag, den 31. August 2002:

> Grepping the source for incomplete turned out to reveal the article
> on out.going no longer had +x. I must've seen it wrong when I
> checked that. No matter, it seems fixed now, my fault.

Ok, so that was the easy part.

> And now for the stracing...
> 
> 24696 fork()                            = 24697
> 24696 open("/var/lock/news/fetchnews.lck", O_RDWR|O_TRUNC) = -1 ENOENT (No such file or directory)
> 24696 time([1030757820])                = 1030757820
..
> 24697 rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 8) = 0
> 24697 unlink("/var/lock/news/fetchnews.lck") = -1 ENOENT (No such file or directory)
> 24697 _exit(0)                          = ?
> 24696 <... wait4 resumed> NULL, 0, NULL) = 24697
> 24696 --- SIGCHLD (Child exited) ---
> 24696 _exit(0)                          = ?
> 
> There was no other mention of fetchnews.lck in the strace than what
> is above.

Interestingly, there was no lock file at the time it should have been
handed over, but it was not lost to a race condition either.

Did you go with the -P option perchance? If so, then I can explain this
behavour; the -P option suppresses the lock file creation, but not
handing it over and things. Please, can you edit the fetchnews.c file
it looks like this (without line numbers):

  2010      if (!postonly) {
  2011          /* only update active when we could read active from all
servers
  2012           */
  2013          if (rc == 0 && updateactive()) if (killactiveread()) rc
= 1;
  2014          writeactive();
  2015      }
  2016
  2017      switch (pid = fork()) {
  2018      case -1:
  2019          syslog(LOG_NOTICE, "fork: %m, running on parent
schedule");
  2020          fixxover();
  2021          unlink(lockfile);
  2022          freeactive(active);
  2023          activesize = 0;
  2024          active = NULL;
  2025          break;

Please add the word "else" on the otherwise empty line 2016 (without quote
marks), recompile and see if your problem is gone, then check if
fetchnews runs properly with and without -P option and report back.

Thanks,
Matthias

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