slrn + leafnode on Mac OS X Installation Howto

deutsch | english | français

Requirements

Installed Apple Developer Tools, you will need to use vim or any other CLI editor to edit some files.

We need to add /usr/local/bin and /usr/local/sbin to the path in order to find our compiled binaries. This works differently depending on which shell you use.

tcsh (default in Mac OS X 10.0 up to 10.2)

The easiest way is sourcing the system examples to your shell.

You can do this by editing /etc/csh.login:

# System-wide .login file for csh(1).
source /usr/share/tcsh/examples/login
setenv MANPATH "${MANPATH}:/usr/local/man"

The terminal application must be restarted for the changes to take effect.

bash (default from Mac OS X 10.3)

– to be written –

leafnode

leafnode 2

Version 2 of leafnode is an alpha version. I successfully tried 2.0.0.alpha20061010a and PCRE 6.7, but any recent version should do.

You have to create the user “news” before compiling leafnode. The easiest way would be running the shell script adduser-news.sh:

% sudo ./adduser-news.sh

Now download and install PCRE and leafnode.

% curl -O ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-6.7.tar.bz2
% curl -O http://www.dt.e-technik.uni-dortmund.de/~ma/leafnode/beta/leafnode-2.0.0.alpha20061010a.tar.bz2
% tar xjf pcre-6.7.tar.bz2
% tar xjf leafnode-2.0.0.alpha20061010a.tar.bz2
% cd pcre-6.7/
% ./configure
% make
% sudo make install
% cd ../leafnode-2.0.0.alpha20061010a/
% ./configure --sysconfdir=/Library/Leafnode --enable-spooldir=/private/var/spool/news
% make
% sudo make strip-install

Okay, now that you’ve read all this so patiently, I’d like to point you to my new Leafnode Installer (test version) which could save you from compiling for yourself.

Configure leafnode

$ cd /Library/Leafnode
$ sudo cp config.example config
$ sudo vi config

Make the appropriate changes. Example for my configuration:

server = news.arcor.de
expire = 10
initialfetch = 100
maxcrosspost = 5
hostname = <mydomain>

Please refer to the included FQDN Readme for what to put for “hostname”.

Download a list of all newsgroups and install a cronjob

$ sudo /usr/local/sbin/fetchnews -vv
$ sudo crontab -u news -e

Edit the file as follows:

0 22 * * * /usr/local/sbin/texpire

That means old articles will be deleted every day at 10 pm. Of course you can choose any other time your computer is mostly running.

Starting leafnode

leafnode can be started in different ways:

inetd (≤ Mac OS X 10.2)

Make inetd know about leafnode:

$ sudo vi /etc/inetd.conf

Insert this line:

#nntp  stream  tcp  nowait  usenet  /usr/libexec/tcpd  nntpd
nntp  stream  tcp  nowait  news    /usr/libexec/tcpd  /usr/local/sbin/leafnode

Restart inetd:

$ sudo kill -HUP `cat /var/run/inetd.pid`

leafnode has no authentication methods, so tcpd is used to control access. This is configured in /etc/hosts.allow and /etc/hosts.deny.

Example (Access granted from local net 192.168.64.0/24):

/etc/hosts.deny

leafnode: ALL

/etc/hosts.allow

leafnode: 127.0.0.1 192.168.64.0/255.255.255.0

xinetd (Mac OS X 10.3)

Add a configuration file for leafnode in /etc/xinetd.d:

$ sudo vi /etc/xinetd.d/nntp

File contents:

service nntp
{
        disable         = no
        socket_type     = stream
        wait            = no
        user            = news
        server          = /usr/local/sbin/leafnode
        only_from       = 192.168.64.0
        groups          = yes
        flags           = IPv4
        session_create  = yes
}

Restart xinetd:

$ sudo kill -HUP `cat /var/run/xinetd.pid`

launchd (Mac OS X 10.4 Tiger)

File /Library/LaunchDaemons/de.netzallee.leafnode.plist:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>Label</key>
	<string>de.netzallee.leafnode</string>
	<key>Program</key>
	<string>/usr/local/sbin/leafnode</string>
	<key>ProgramArguments</key>
	<array>
		<string>/usr/local/sbin/leafnode</string>
	</array>
	<key>Sockets</key>
	<dict>
		<key>Listeners</key>
		<dict>
			<key>Bonjour</key>
			<true/>
			<key>SockServiceName</key>
			<string>nntp</string>
		</dict>
	</dict>
	<key>UserName</key>
	<string>news</string>
	<key>inetdCompatibility</key>
	<dict>
		<key>Wait</key>
		<false/>
	</dict>
</dict>
</plist>
% sudo launchctl load /Library/LaunchDaemons/de.netzallee.leafnode.plist

Download news

To download news articles, use sudo /usr/local/sbin/fetchnews. You could also set up a cron job to do that.

slang

Install slang. This became simpler with the newer versions.

% curl -O ftp://ftp.uni-stuttgart.de/pub/unix/misc/slang/slang/v1.4/slang-1.4.6.tar.bz2
% tar xjf slang-1.4.6.tar.bz2
% cd slang-1.4.6
% ./configure
% make all
% sudo make install-elf install-links

slrn

Download and install slrn

% curl -O ftp://ftp.fu-berlin.de/pub/unix/news/slrn/slrn-0.9.7.4.tar.bz2
% tar xjf slrn-0.9.7.4.tar.bz2
% cd slrn-0.9.7.4
% ./configure
% make
% sudo make install

Edit the file ~/.cshrc (per user), or /etc/csh.login (system-wide):

setenv NNTPSERVER localhost
setenv COLORTERM ""

These settings will take effect after the terminal is restarted.

We need to change the terminal settings in “Window Settings – Display”. Choose character set “Western (ISO Latin 1)” until slang/slrn support UTF-8. Now customize the slrn configuration file (~/.slrnrc).

You can use whatever editor you like for writing articles. I use vim.

Now slrn is ready to be started (only on first start the file .jnewsrc must be generated).

% slrn --create

Screenshot

screenshot.png


Revisions of this document

You are here: home > technical > slrn + leafnode on Mac OS X

Say cheerio to books now. The only things I read are faces.