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

leafnode-1 not writing active.read (was: [leafnode-list] cannot stat /var/spool/news/leaf.node/:active.read)



Tim Daneliuk schrieb am 2003-08-16:

> It seems that active.read (even if I create it manually as originally
> described) _never_ gets touched/updated.  There are two upstream
> news servers in my configuration, both of which return their lists
> of active groups just fine.

Strange. Can you apply the patch below, recompile (see below for
debugging options) and see if you're getting error messages (timeout)
now? What exit code does fetchnews return to the shell? Run "fetchnews
-v [options] ; echo $?", replacing [options] by your options to find
out. Are you getting a message such as "Started process to update
overview data in the background."? (You /must/ run with at least one -v
argument to see it, it appears on stdout.)

If we don't find anything else, can you run fetchnews under gdb
supervision? If so, place a breakpoint at "main" (b main), run it (run
-v), when it breaks in "main", type "watch rc", then "continue" and when
it breaks because rc has changed ('watchpoint has been hit'), then type
"where" and show me the stack backtrace. To get more useful logging,
recompile leafnode first:

With GCC and GDB:

env CFLAGS="-ggdb" ./configure

With other C compilers and debuggers:

env CFLAGS="-g" ./configure

then make and make install as usual.

> HOWEVER, there are name conflicts
> between the two reported such as:
> 
> Aug 16 13:48:12 eskimo fetchnews[70137]: Newsgroup name conflict, chose
> symantec.support.devtools.windows.vcafe4java.runtime.n
> ative

They are harmless and don't cause active.read to be omitted.

Here's the patch:

Index: fetchnews.c
===================================================================
RCS file: /var/CVS/leafnode-1/fetchnews.c,v
retrieving revision 1.113
diff -u -r1.113 fetchnews.c
--- fetchnews.c	2 Jul 2003 13:06:30 -0000	1.113
+++ fetchnews.c	17 Aug 2003 09:46:51 -0000
@@ -1442,8 +1442,11 @@
 		prependtolist(&groups, l);
 	    }
 	}
-	if (!l)			/* timeout */
+	if (!l) {		/* timeout */
+	    ln_log(LNLOG_SERR, LNLOG_CTOP,
+		    "Reading new newsgroups failed, timeout.");
 	    return -1;
+	}
 	if (merge) {
 	    mergegroups();	/* merge groups into active */
 	    merge = 0;
@@ -1524,8 +1527,11 @@
 	    }
 	}
 	mergegroups();
-	if (!l)			/* timeout */
+	if (!l) {		/* timeout */
+	    ln_log(LNLOG_SERR, LNLOG_CTOP,
+		    "Reading all newsgroups failed, timeout.");
 	    return -1;
+	}
 	if (current_server->descriptions) {
 	    xsnprintf(lineout, SIZE_lineout, "LIST NEWSGROUPS\r\n");
 	    putaline();
@@ -1564,10 +1570,13 @@
 		changegroupdesc(l, *p ? p : NULL);
 		l = getaline(nntpin);
 	    }
+	    if (!l) {		/* timeout */
+		ln_log(LNLOG_SERR, LNLOG_CTOP,
+			"Reading newsgroup descriptions failed, timeout.");
+		return -1;
+	    }
 	}
 	debug = debugmode;
-	if (!l)
-	    return -1;		/* timeout */
     }
     return 0;
 }
@@ -1990,6 +1999,7 @@
 	    if (fsync(fileno(f))) rc = -1;
 	    if (fclose(f)) rc = -1;
 	} else {
+	    /* f == NULL, open error */
 	    rc = -1;
 	}
     } else {
@@ -2000,7 +2010,8 @@
 	    rc = -1;
 	}
     }
-    if (rc) ln_log(LNLOG_SERR, LNLOG_CTOP, "cannot update or create %s: %m", s);
+    if (rc)
+	ln_log(LNLOG_SERR, LNLOG_CTOP, "cannot update or create %s: %m", s);
     free(s);
     return rc;
 }

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