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

Re: Of news readers, slurpers, and servers...



On Mon, Jul 05, 1999 at 11:30:21PM -0400, Jonathan Lupa wrote:
> On Tue, Jul 06, 1999 at 01:22:59AM +0100, Mark Brown wrote:

[Leafnode]

> 1. Support for multiple servers is done through the suplement= setting.

> In my situation, I have a primary news server that is going to get me the
> standard stuff (c.l.c++.m), and then a secondary news server that handles
> palm GCC coding (news.massema.com).  All posts to the pilot.* groups need
> to go through the massema server, and all others need to go through
> the main server.  Is this possible with leafnode?

My understanding is that this is exactly what should happen - I've never
used multiple servers myself.

> 2. I would like to set groups to never expire. Is that done by setting their
> groupexpire setting to some insanely large rational number. Like, just this
> side of countably infinite?

Yes.  There's no explicit setting for this, so just set an extremely
large expiry time.  You might want to watch out for integer overflow.

> 3. I would like to get certain groups all the time, no matter what.  Leafnode
> looks to be going out of its way to be smart about this. Can I override
> this intelligence to make it get me groups that I never read (because sometimes
> I'm a lazy guy)?

Not in Leafnode itself.  However, the next version of the package will
include a simple script (attached) which will run from cron.daily as
shown below.  It reads groups so you don't have to (the example here
reads a list from /etc/news/leafnode/touch_groups).

if [ -f /etc/news/leafnode/touch_groups ]; then
   su news -c "/usr/bin/touch_newsgroup -f /etc/news/leafnode/touch_groups"
fi

You can also set timeout_long, but depending on how infrequently the
group is read this still may not be enough and it will affect all groups.

The underlying mechanism for remembering which groups are downloaded is 
to create files in /var/spool/news/interesting.groups/, but this could
change in future releases so the script is probably safer.

-- 
Mark Brown  mailto:broonie@tardis.ed.ac.uk   (Trying to avoid grumpiness)
            http://www.tardis.ed.ac.uk/~broonie/
EUFS        http://www.eusa.ed.ac.uk/societies/filmsoc/
#!/usr/bin/perl -w
#============================================================================
#
# touch_newsgroup
#
#   Utility to force leafnode to download news from very-low traffic
#   newsgroups by reading the last article from the newsgroup.
# 
#   Copyright (c) 1999 Jim Nicholson <j.nicholson@computer.org>.
# 
#   This program is free software; you can redistribute it and/or modify
#   it under the terms of the GNU General Public License as published by
#   the Free Software Foundation; either version 2 of the License, or
#   (at your option) any later version.
#
#   This program is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
#   GNU General Public License for more details.
#
#   You should have received a copy of the GNU General Public License
#   along with this program; if not, write to the Free Software
#   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#============================================================================

use strict;
use Getopt::Std;
use Net::NNTP;

my %option = ();
getopts("f:h:v", \%option);
die "No groups specified\n" if (($#ARGV == -1) && (!$option{f}));
my $nntp_host = $option{h} || "127.0.0.1";

my $server = Net::NNTP->new($nntp_host)
  or die "Can't connect to news server: $@\n";
print "touching newsgroups on server $nntp_host\n" if ($option{v});

if ($option{f}) {
  open GROUPFILE, $option{f} or die "Cannot open $option{f}\n";
  while (<GROUPFILE>) {
    chomp;
    read_article($_);
  }
  close GROUPFILE;
}

foreach (@ARGV) {
  read_article($_);
}

sub read_article {
  my ($groupname) = @_;
  my ($narticles, $first, $last, $name) = $server->group($groupname)
    or die "Can't select $groupname\n";
  if ($narticles > 0) {
    my $lines = $server->article($last)
      or die "Can't get article $last in $name\n";
    print "read article number $last from $name\n" if ($option{v});
  } else {
    print "no articles in $name\n";
  }
}

Attachment: pgp8hg8csLJYP.pgp
Description: PGP signature


Reply to: