The Sysadmin's Daily Grind: Leafnode

Group Therapy


Leafnode is a Usenet server for small sites where just a few users need access to a large number of groups. The Leafnode server is designed to recover from errors autonomously and needs very little attention.

By Charly Kühnast

If you are faced with the task of setting up a news server, you might discover INN in your package management tool. The INN daemon is powerful and flexible, and it scales well. On the downside, INN can be hungry on resources, depending on the configuration and peerings, and maintenance is not exactly trivial. In fact, INN is total overkill for smaller workgroups, and this is where Leafnode steps in.

Although Leafnode is formally an NNTP server, it might be more fitting to refer to Leafnode as a news proxy. To save resources, the Leafnode server does not attempt to store every article in every newsgroup. If a user subscribes to a newsgroup, Leafnode will tell the user that the postings for the group are not available and offer to fetch the postings from a real news server.

As long as the newsgroup is read with some kind of regularity, Leafnode will keep the group up to date. If a group remains unread for a configurable period of time, Leafnode cancels the subscription to the newsgroup. The Leafnode system is perfect for travel. Leafnode plays an important role on my laptop. When I am on the road, and I only have access via an expensive modem line in my hotel room, I just tell Leafnode to fetch the latest news and then close the connection. I can then browse through my favorite newsgroups in offline mode.

Daemon-free Zone

Any popular Linux distribution should have Leafnode, so there is no need to build the package yourself. But if you still prefer to do so, you can check out the homepage at [1], which gives you a link where you can download the source code. The Leafnode daemon does not run permanently but is launched via Inetd, Xinetd, or Tcpserver. The Xinetd configuration might look like this, for example:

service nntp
{
    socket_type    = stream
    protocol       = tcp
    wait           = no
    user           = news
    server         = /usr/sbin/leafnode
}

You will also need to tell Leafnode where to find its data source: the authoritative, genuine news server. You need to add this server's name or IP address to the Leafnode configuration file, typically /etc/leafnode/config, and to the /etc/nntpserver file. Finally, you need a cronjob for the news account that removes obsolete articles from the collection:

0 4 * * * /usr/local/ sbin/texpire

Fetchnews picks up new postings for newsgroup subscriptions from the

master server and feeds them to the Leafnode spooler. The tool is part of the Leafnode package. If you have permanent Internet access, you can add a call to Fetchnews to your crontab. Dial-up users - just like me in the hotel - might prefer to add Fetchnews to their ip-up scripts or execute the command manually.

Just a few words on Leafnode's security features: " ". Exactly: Leafnode doesn't have any security! If you want to avoid spammers hijacking your news proxy, make sure port 119 is blocked for access from the Internet. That's my kind of (news) group therapy!

INFO
[1] Leafnode: http://leafnode.sourceforge.net
THE AUTHOR

Charly Kühnast is a Unix System Manager at the data-center in Moers, near Germany's famous River Rhine. His tasks include ensuring firewall security and availability and taking care of the DMZ (demilitarized zone).