Leafnode+

TopPageにも書きましたが、OpenBlockS200でLeafnode+を常時動かしていたせいなのかどうかわかりませんが、HDDの調子が悪くなりました。(^^;

なので、いまはLeafnode+を動かしていません。(そのせいか、HDDも調子がいいです。)

 

用意するもの

 

ソースファイルの展開

/usr/local/src/ にソースファイルを用意し、tarで展開。

[root]# cp /tmp/leafnode+-2.14.tar.gz /usr/local/src/.
[root]# cd /usr/local/src/
[root]# tar zxvf leafnode+-2.14.tar.gz

 

Makefileの変更

基本的には、/usr/local/src/leafnode+-2.14/INSTALL の手順で作業を進める。

Makefileは以下の変更を加えた。

--- Makefile.org Thu Jun 14 02:53:27 2001
+++ Makefile Fri Jan 10 02:07:34 2003
@@ -6,10 +6,10 @@
#
# You can specify programs that this makefile uses here.
# Programs for compilation.
-#CC = gcc
+CC = gcc
#CC = cc
-#AR = ar
-#RANLIB = ranlib
+AR = ar
+RANLIB = ranlib
# Programs for distribution.
CP = cp
CHMOD = chmod
@@ -72,7 +72,7 @@
#
# This is the directory where the configuration and group information is
# kept. It should preferably not be on the same partition as spooldir
-LIBDIR = /usr/lib/leafnode
+LIBDIR = /usr/local/lib/leafnode
#
# These are about local library.
LIBUTIL = libutil.a

 

newsグループとユーザを作成

news というユーザとグループを作成。

[root]# groupadd news
[root]# useradd -g news news

 

インストール

make installall を実行。

[root]# make installall

 

 

nntpserverファイルの作成

/etc/nntpserver というファイルを作成し、その中にニュースサーバー名を記載する。

 

configファイルの作成

/usr/local/lib/leafnode/config というファイルを作成する。config.example ファイルをコピーするのが便利。

以下は私が設定した内容。
news.cis.dfn.de を使っているので、username と password を設定している。
※※ news.cis.dfn.deは有料になったそうなので、代わりとしては京都大学の「公開ネットニュースサービス」を使うと良いと思います。

server = news.cis.dfn.de <-- 記事を取ってくるニュースサーバー
postable = 1 <-- 記事の投稿を許可
username = xxxxxxxx <-- username と password
password = ********
newsgroups = fj.* <-- 読みたいニュースグループ
newsgroups = japan.*
newsgroups = tnn.*
newsgroups = gnu.*
timeout_short = 7
timeout_long = 21
timeout_active = 14
expire = 5 <-- expire のデフォルトを5日にする
groupexpire = fj.* 30 <-- fj.* だけ expire を30日に変更
maxcount = 10000

 

fetchnews

newsユーザで、/usr/local/sbin/fetchnews を実行。

[news]# /usr/local/sbin/fetchnews
Segmentation fault

たぶん、Segmentation fault というエラーが出るはず。エラーが出たら、/usr/local/lib/leafnode/groupinfo というファイルのパーミッションを変更。

[news]# chmod 664 /usr/local/lib/leafnode/groupinfo

もう一回、/usr/local/sbin/fetchnews を実行。また、Segmentation fault エラーが出るはず。

[news]# /usr/local/sbin/fetchnews
Segmentation fault

***.active というファイルができるが、activeなしのファイルも作成。

[news]# cp news.cis.dfn.de.active news.cis.dfn.de

もう一回、/usr/local/sbin/fetchnewsを実行すれば正常終了するはず。

[news]# /usr/local/sbin/fetchnews

 

/etc/inetd.conf の編集

/etc/inetd.confファイルを編集し、以下の行を追加。

nntp stream tcp nowait news /usr/local/sbin/leafnode

 

ニュースリーダーの設定

ニュースリーダーで、ニュースサーバー(OpenBlockSS)のアドレスなどを設定し、ニュースが読める環境にする。 ニュースリーダーの設定ができたら、購読するニュースグループを選び、それが終わったらニュースリーダーを一度終了する。

 

記事の取得

/usr/local/sbin/fetchnews を実行し、記事を取得する。

[news]# /usr/local/sbin/fetchnews

これで、ニュースリーダーで記事が読めるようになる。

 

cron の設定

私は下記のような cron を設定している。(news ユーザーで。)

[news]$ crontab -l
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (cron.news installed on Sun Jan 12 11:47:33 2003)
# (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $)
0 4 * * * /usr/local/sbin/texpire <-- 04:00 に記事を expire
*/30 * * * * /usr/local/sbin/fetchnews <-- 30分ごとに記事を取得

 


Made with Dreamweaver MX