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

Re: [leafnode-list] leafnode and avtive groups



On Wed, 26 May 1999, Heinz-Dieter Conradi <conradi@xxxxxxx> wrote:
> no matter how often one visits a newsgroup, after 7 days leafnode
> doesn't fetch the groups and removes this item from the
> interesting-news folder.  only after again visiting this group (and
> thereby again creating a new item in interesting-news) the news are
> fetched again.  this happends although the news-program(s) correctly
> set the filedates.

What are your timeout_short and timeout_long values?  The test, in
fetch.c, is

	sprintf( s, "%s/interesting.groups/%s", spooldir, g->name );
	if ( stat( s, &st ) < 0 )
	    return last;
	if ( ((st.st_mtime == st.st_ctime) && 
	      (now-st.st_ctime > (timeout_short * SECONDS_PER_DAY) ) )
	     || (now-st.st_mtime > (timeout_long * SECONDS_PER_DAY) ) ) {
	    if ( verbose > 1 )
		printf("skipping %s from now on\n", g->name);
	    syslog( LOG_INFO, "skip %s (%d): %d, %d", g->name, now,
		    now-st.st_ctime, now-st.st_mtime );
	    unlink(s);

Thus, if the group is in interesting.groups, and if
    the file's modify time = its creation time and it's been more than
        timeout_short since its creation
or
    it's been more than timeout_long days since its last modification
then the group is no longer interesting.

I assume that it is intended that ctime (create time) for the group's
file in interesting.group is set for the first time you enter the
group, and mtime is updated every time you read the group.

The first clause attempts to check whether the group was accidentally
touched once -- if you only touched it once, its modify time would
equal its create time -- and you haven't gone into the group in
timeout_short days.

The second clause checks whether you've entered the group more than
once, yet haven't read it in more than timeout_long days.

You can check your interesting.groups directory by "ls -l" to see the
mtimes and "ls -lc" to see the ctimes, and "play computer" with the
above code.  You can also save news info messages to get the logging
info.  On my RedHat 5.2 system, it does not save such messages by
default.  I think that putting

news.=info                                        /var/log/news/news.info

into /etc/syslog.conf should save those messages.

It seems to work for me: fetch updates the mtime when I read the
group, by calling markinterest() in nntpd.c when I read.  However,
perhaps I am missing something.

I had the further problem that I was not visiting some groups at all
within my timeout windows.  Nevertheless, I wanted all my subscribed
groups fetched because I plan to get around to them someday.

I have a script "get-news".  It does a lot of things: it dials my ISP,
it fetches mail, it sends mail, it arranges a hangup on timeout, et
cetera.  In particular, I have code to modify outgoing articles so
they appear to come from my ISP, and to put them into a "outgoing
saved folder".  (Those might be nice leafnode options: forge_from or
news_system or something, and outgoing_save_folder or something.)

I also have it rm all of interesting.groups, and then read my .newsrc
and add a new file for every subscribed group.  Therefore, if I
unsubscribe from a group, fetch stops fetching it at once, and I never
get to timeout at all.

(
    set -x
    # Save copies of all outgoing articles in $sentbox.
    cd /var/spool/news/out.going && if [ `ls | wc -l` -ne 0 ]; then
        chmod u+w *
        perl -pi -e 's/^(From:.*)tmcd\@tmcd\.austin\.tx\.us/$1tmcd\@jump.net/' *

        cp -f * "$sentbox"
    fi
    set +x
    # Make sure that all subscribed groups in my newsrc are fetched,
    # and only those groups, regardless of any leafnode config
    # timeouts.  -- Spell out the dir to rm explicitly, so no
    # unpleasant defaults are used!
    cd /var/spool/news/interesting.groups && perl -e '
        use strict;
        my $cmd;
        $cmd = "rm /var/spool/news/interesting.groups/*";
        # print $cmd, "\n";
        system($cmd);
        while (<>) {
            chomp;
            s/:.*// or next;
            $cmd = "touch $_";
            # print $cmd, "\n";
            system($cmd);
        }' < "$MCDANIEL/News/.newsrc"
)

Sorry to be so wordy!

-- 
                   *** NEW HOME E-MAIL ADDRESS ***
Tim McDaniel (home); Reply-To: tmcd@xxxxxxxx; 
if that fail, my work addresses are  tmcd@xxxxxxxxxxxxxx and tmcd@xxxxxxxxxxx
tmcd@xxxxxxxxxxxxxxxxx is a lie; tmcd@xxxxxxx is old and will go away.

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