======================================================================
BBS <==> News תųʽ innbbsd 
======================================================================
<1>. ܼ
<2>.  Server Gateway (innbbsd) װʹ
   a. 趨 bbsname.bbs
   b. 趨 nodelist.bbs
   c. 趨 newsfeeds.bbs
   d. 趨 innbbs.conf
   e. ִ innbbsd (options )
<3>.  Client Gateway (bbsnnrp) װʹ
   a. 趨 activefile
   b. ʱ bbsnnrp
<4>. ųʽ bntplink װ趨   
   a. bbaname.bbs  bntplink
   b. nodelist.bbs   bntplink
   c. newsfeeds.bbs  bntplink
   d. ִ bntplink
<5>. Server gateway innbbsd Ƴʽ (ctlinnbbsd) 
<6>. activefile and history database
<7>. BBS implementation dependent part: receive_article.c
<8>. תżܹ
<9>.  and FAQ
======================================================================
<1>. ܼ
----------------------------------------------------------------------
A). ʽ (client gateway) ͱʽ (server gateway) תŵıȽ
----------------------------------------------------------------------
Ŀǰ tw.bbs תŵ BBS վ֮ʽմŵķʽ
Ϊ:
1. ȡŵ, Ϊ client gateway.
   һ㾭 modem 绰ӵ BBSվô˷ʽ
   news client  news server ʱȡ.
   NSYSU Formosa BBS ֮תųʽһ client gateway.
2. ŵ, Ϊ server gateway.
   BBS վһ server, ֻܱصȴվι,
   һ news server  news article ķ.
   Phoenix BBS ֮ in.bntpd һ server gateway.

   gateway ȱ. :
1. client gateway  maintain ȡļ¼, һ
   news reader  newsrc .  client Ը, 
   ʱȥȡ, ҪЩ.
2. server gateway  maintain ȡ¼, ֻҪصȴվ
   ͹. server gateway Ƚ, ʱι֮.
   վ趨.

BBS վά֮Ѷ, Ծһ gateway.
1. ȡ֮.
   , client gateway ȽϺ. ܶ, Ӧǲ server gateway.
   ȡ¼ά,  news server ڻ renumber active 
   , client .
2. Ƿͬת, ĳվһͳ, վϿɿ.
   ֻ server gateway .
3. ǷҪվ.  client gateway Ƚ.
   ҪܱܽվĿѶϢ,
   a. Ҫȡһ Ϊ "control"  "control.cancel"  news .
      ͨ൱, Զ BBS վת.
   b. ¼ artno  BBS article path ĶӦϵ,  stat news server.
   c. extract header (xhdr Control)
   server gateway նɿվ.
4. ʹûʹ߲ BBS վ client gateway.
   û, תŲӰȽϴ,
    server gateway.
5. ҪԸߵ client gateway.
   Ҫн, һ߸о server gateway.

----------------------------------------------------------------------
B). innbbsd 
----------------------------------------------------------------------
 mfchen  bbsinnd ( perl) server gateway,
ɽ BBS  news-bbs client gateway,  C 
, ֧Ԯ Sun-OS 4.x, Sun Solaris, HP-UX, IRIX, 
AIX  Linux. 

innbbsd  server gateway  client gateway. 
ϣûͬ. :
  1.  C implement.
  2. ֧Ԯ OS.
  3. server gateway  client gateway .
     ɽܶ news server feed   client gateway
     process ͬʱ.
     client gateway process  BBS server ִ.
     ͬͬʱɶ news server ι, Ӳͬ
     news server ȡ.
  4.  host load Ӱڲ.
  5. server gateway  client gateway վ.
  6. յظ.
  7. server gateway ɲ news server ʹ BBS վתż.
  8. standalone single process concurrent server(ŵ ?.)
  9  server gateway  bbsinnd .
                             
 ȱ:
  1.  maintain һ 1MB ҵ dbz ϵ.
  2. client gateway Ҫ server gateway ʹ. ʹ
      news server feed, ҲҪ server gateway.
     Ŀǰ client gateway process ǵһ
     user ص feed Դ.  client gateway process 
     BBS server  unix-domain socket feed  server gateway
     ڲͬ host  inet/tcp ι BBS server.
      mfchen  bbsinnd ϴ client gateway.
  3. standalone process (ȱ ?.)
  4. BBS -> News  mfchen  bntplink. Ϊ֧Ԯ
     client gateway.
 ----------------------------------------------------------------------
======================================================================
<2>.  Server Gateway (innbbsd) װʹ
   a. 趨 bbsname.bbs

b. 趨 nodelist.bbs
   innbbsd  nodelist.bbs ߻.
   
#sitename hostname                 PROT(port) comments
bbsroute  bbsroute.xxx.nctu.edu.tw POST(119) xxxx news server

    bbssroute.xxx.nctu.edu.tw  connect.
   
c. 趨 newsfeeds.bbs
d. 趨 innbbs.conf
e. ִ innbbsd (options )
 ----------------------------------------------------------------------
!!!  !!!
ǰ뱸ݹ BBS վ.
!!!!!!!!!!!!

You can get from 

ftp://ftp.csie.nctu.edu.tw/pub/bbs/misc/innbbsd/innbbsd-??.tar.gz

patch from the previous version, use
patch -p1 < innbbsd-patch.xx-xx

A. FEATURES:
   1. support Sun-OS, Solaris, Linux, AIX, IRIX, HP-UX 
   2. carry(receive) news from mulitple servers
      by mulitple client gateways or server gateways.
   3. feed multiple servers (BBS or News) by post or ihave protocol to
      different port number (nntp ,7777, ....)

B. Test and Install

   1. Please read innd/README and 
      change your newsfeeds.bbs, nodelist.bbs, and bbsname.bbs
   2. read innd/src/modify.doc

   3. edit Makefile and change these two lines:
   BBSHOME=/u/staff/bbsroot/csie_util/bntpd/home
   BBS_SRC=/u/staff/bbsroot/bbs_src
     
      into

   BBSHOME=/tmp/bbs
   BBS_SRC=/your/bbs-src-directory

   4. make
   5. mkdir /tmp/bbs/boards /tmp/bbs/boards/test /tmp/bbs/innd
      copy your newsfeeds.bbs, nodelist.bbs and bbsname.bbs to /tmp/bbs/innd
   6. add to newsfeeds.bbs
      tw.bbs.test test test-news
   7. add to nodelist.bbs
      test-news news-server-your-want-to-post POST(119) 
      your-site-name your-host-domainname     IHAVE(7777)
   8. add a line to innd/test-news.active
      tw.bbs.test 0000000000 0000000001 y
   9. run 
      innbbsd
      bbsnnrp news-server-your-can-read innd/test-news.active
  10. examine if /tmp/bbs/boards/test has some files and make sure if
      OK.  

C. Install and Run your Server Gateway
   ϲ.  Makefile 
   BBSHOME=\"/tmp/bbs\"
   BBS_SRC = /your/bbs-src-directory
   趨ȷ֮ BBSHOME. 
   make clean
   make
   kill `cat /usr/tmp/innbbsd-7777.pid`
   
   su  bbsuser ( bbs ͬ uid)
   1. ʹܹ mfchen  in.bntpd, ת history :
      hisconvert ~bbs/usr/tmp/history ~bbs/usr/tmp/history.z > ~bbs/innd/history 
      mkhistory ~bbs/innd/history
   2. innbbsd port-no (default=7777) 
    
D.  client (bbsnnrp) gateway
   1. ÿ bbsnnrp process òͬ active file.  active file
       bbsnnrp process ʹʱ, ޸. ޸ǰͣ(ɱ) bbsnnrp process.  
   2. active file format :
      newsgroup-name high-number low-number y
      ....... 
      
      :
      tw.bbs.test 0000000000 0000000001 y
      tw.test 0000000000 0000000001 y
      
   3.  news server  news.csie.nctu.edu.tw, 
      active file  ~bbs/innd/news.csie.nctu.edu.tw.active
      
      bbsnnrp news.csie.nctu.edu.tw ~bbs/innd/news.csie.nctu.edu.tw.active
      
   4. Ҫվ, news server  control.cancel   
      control.cancel 0000000000 000000001 y
       control.cancel  
      control 0000000000 000000001 y
      
      һ 
        bbsnnrp -c server control-active-file
      
      bbsnnrp  control  control.cancel ر, ֻȡҪ header.
      
   5. һ bbsnnrp, 鲻Ҫȡ, ֻ reset active file, 
      bbsnnrp -c server-to-receive active-file   
      
   6. ɽ϶ӵ crontab ʱץ,     
      bbsnnrp -w wait-time ......... &
       bbsnnrp ÿ wait-time ץһ.
      
   7. bbsnnrp ,  
      BBS host: bbs.dorm10.nctu.edu.tw
      bbsnnrp host: ccsun1.cc.nctu.edu.tw
     
       bbs.dorm10.nctu.edu.tw  innbbsd 7777  
      ccsun1.cc.nctu.edu.tw  nodelist.bbs, 
      bbsnnrp-ccsun1 ccsun1.cc.nctu.edu.tw
      
      
      bbsnnrp -r bbs.dorm10.nctu.edu.tw -p 7777 server active-file
            
E. Feed  news servers  BBS server
   ޸ nodelist.bbs, newsfeeds.bbs ,
    nodelist.bbs
   news-server1 news-server1-full-domain IHAVE(119) comment .. server gateway
   news-server2 news-server2-full-domain POST(119)  comment .. client gateway
   bbs-server1  bbs-server1-full-domain  IHAVE(7777) comment .. server gateway
   bbs-server2  bbs-server2-full-domain  IHAVE(7777) comment .. server gateway
   
   newsfeeds.bbs
   tw.bbs.test test news-server1 news-server2 bbs-server1 bbs-server2
   tw.test     twtest news-server2 bbs-server1
   ........
   
                          
F. Related commands
   innbbsd [portno]
   bbsnnrp [options]
   mkhistory history-file
   makedbz history-size

G. ˵
   innbbsd ֻһֻ, ն news server  bbs server feed.
   bbsnnrp ֻܶ, .
   
   innbbsd  bbsnnrp յ newsgroups ظ.
   
H. BBS վ͸ News server ת   
   nodelist.bbs 
   bbs-server1 bbs-server1-host-name IHAVE(7777)
   bbs-server2 bbs-server2-host-name IHAVE(7777)
   
   newsfeeds.bbs
   newsgroups  board-name name1 name2 ...
   tw.bbs.test test       bbs-server1 bbs-server2
 ------------------------------------------
 innbbsd options:
 Usage: ./innbbsd [options] [port [path]]
        -v (verbose log)
        -h|? (help)
        -n   (not to use in core dbz)
	-i   (start from inetd with wait option)
        -c connection  (maximum number of connections accepted)
======================================================================
<3>.  Client Gateway (bbsnnrp) װʹ
   a. 趨 activefile
   b. ʱ bbsnnrp
 client gateway  " news".
ͬʱ
1.  A server ȡ a group,  B server ȡ b group.
   a  b ͬͬ.
   ,  netnews.ntu.edu.tw ȡ ntu.dep.csie,ntu.dep.ee,tw.bbs.*
          aidebbs.edu.tw ȡ csie.bbs.aidesysop,tw.bbs.*
          news.mgt.ncu.edu.tw ȡ ncu.mgt.*
   òͬ active file,  act1, act2, act3
   
   bbsnnrp netnews.ntu.edu.tw act1
   bbsnnrp aidebbs.edu.tw act2
   bbsnnrp news.mgt.ncu.edu.tw act3
                                       
2. ɢ load, ·ṹ, һ̨ bbsnnrp ר host, ֻ bbsnnrp,
   ι BBS servers  news servsers.
   ( "͵" news)
   bbsnnrp -r bbs1.domain1 -p 7777 newsa.domainb bbs1.newsa.active
   bbsnnrp -r bbs2.domain2 -p 7777 newsb.domainb bbs2.newsb.active
      bbsnnrp -r newsc.domainc -p 119 newsx.domainx newsc.newsx.active
   ( newsx ȡ news ι newsc, a gateway ? )
   ............................
         
Ȼȡʱò server ͬ.
---------------------
bbsnnrp options:
Usage: ./bbsnnrp [options] nntpserver activefile
       -h|? (help) 
       -v (verbose protocol transactions)
       -c (reset active files only; don't receive articles)
       -r remotehost(send articles to remotehost, default=local)
       -p port|(send articles to remotehost at port, default=7777)
          path(send articles to local at path, default=~bbs/innd/.innbbsd)
       -w seconds ( > 1 wait for seconds and run infinitely, default=once)
       -n (don't ask innbbsd server and stat articles)
       -a max_art(maximum number of articles received for a group each time)
          default=100
       -s max_stat(maximum number of articles stated for a group each time)
          default=1000
       -t stdin|nntp (default=nntp)
       -g newsgroups

Please E-mail bug to skhuang@csie.nctu.edu.tw or
post to tw.bbs.admin.installbbs
======================================================================
<4>. ųʽ bntplink װ趨   
   a. bbaname.bbs  bntplink
   b. nodelist.bbs   bntplink
   c. newsfeeds.bbs  bntplink
   d. ִ bntplink
bbsnnrp ֻȡ news, ת news ȥҪ "bntplink".
ܱǸûн.  bntplink ÷ο bbsnnrp-??/innd/README
( README  Phoenix BBS innd ,  nodelist.bbs  newsfeeds.bbs
 дͬ,  innbbsd . in.bntpd Ҳü,  innbbsd)
 
һ bntplink ǰִ ( BBS home  /home/bbs/)
cmd> bbspost visit /home/bbs       # һִлǳ
     New article listed:
     test    M.770323413.A   SYSOP    ...
     ....                                    # гδ
      test board post һƪ, Ȼִ
cmd> bntplink /home/bbs
bntplink Ҫ bbsnnrp-??/innd/bntplink  Phoenix BBS ڸ.
 newsfeeds.bbs  nodelist.bbs дҲ Phoenix BBS  innd ͬ.
                                                             
======================================================================
<5>. Server gateway innbbsd Ƴʽ (ctlinnbbsd) 
  ctlinnbbsd reload   : reload datafiles for innbbsd
  ctlinnbbsd shutdown : shutdown innbbsd gracefully
  ctlinnbbsd mode     : examine mode of innbbsd
  ctlinnbbsd addhist <mid> path: add history
  ctlinnbbsd grephist <mid>: query history
  ctlinnbbsd hismaint : maintain history
  ctlinnbbsd getrusage: get resource usage (-DGETRUSAGE)
  ctlinnbbsd mallocmap: get malloc map     (only Sun-OS supported)
======================================================================
<6>. activefile and history database
a. Ҫ bbsnnrp ӵ crontab и谡
 command line һ.
for example, ÿʮȡһ:
10,20,30,40,50 * * * * /home/bbs/innd/bbsnnrp news-server \
  /home/bbs/innd/active-file > /dev/null 2>&1
  
 bbsnnrp һôǿȤ (Ͳͬ server), ֲͬ active-file
  ԲͬƵȥȡ: 
  1. active1: tw.bbs.rec.rail ( ·վ)
  2. active2: tw.bbs.comp.* 
  3. active3: tw.bbs.rec.* 
  3. active4: control  control.cancel
  
 ÿץ active1, ÿץ active2,
 ÿʮץ active3, ÿץ active3 һ:
* * * * * bbsnnrp news-server active1 > /dev/null 2>&1
0,5,10,15,20,25,30,35,40,45,50,55 * * * * bbsnnrp news-server active2 > /dev/null 2>&1
2,12,22,32,42,52 * * * * bbsnnrp news-server active3 > /dev/null 2>&1
14 3 * * * bbsnnrp news-server active4 > /dev/null 2>&1

:    ץᶼһǰ !!ֻץµ..ҶҪ
:    ظָôʲָ......
  
Default ÿһ group ֻץ 1 ٷ,  news server ɹ,
:
1. Ҫ, һ
   bbsnnrp -c news-server active-file
   ֻ reset active-file ȡ news. ܲ -c, ȡµ.
2. Ҫ,  server load, ֶȡ,  -a ָȡ:
   ÿȡ 500 ,
   bbsnnrp -a 500 news-server active-file
                
   ״ʹ server ץͬ group Ҳظ.
======================================================================
<7>. BBS implementation dependent part: receive_article.c
Rabit ϣ innbbsd ֧Ԯ Palm BBS, Samson Ҳϣдһ
dbz server ֧Ԯ Power BBS, ˳ Secret BBS, Pivot BBS
ܷһ,  Samson dbz server Ҫ, ϣ
PBBS ʹ innbbsd. Ϊ innbbsd õԴҪ
ڴ dbz. ֻҪ PBBS (Palm, Secret,  Pivot) ṩ
receive_article()  cancel_article_front(mid)  routine.
·ʽ:

   innbbsd յ article Ὣ header 浽 extern char *HEADER[]
                                 body        extern char *BODY;
   (Subject 浽 HEADER[SUBJECT_H], From 浽 HEADER[FROM_H], )
    call receive_article()  cancel_article_front(mid)
   PBBS, Palm, Pivot  Secret BBS ֻҪд:
    1. receive_article:  char *HEADER  char *BODY ´淽ʽд.
        call storeDB()  article path 浽 dbz.
    2. cancel_article_front(mid):  call fetchDB(mid)  article filename
       (to be cancelled),  BBS  cancel ʽ.
ܴﵽ¹:
1.  multiple feeds (duplicated feed is OK)
2. only single process (won't fork)
3.  bbsnnrp feed   (bbsnnrp  BBS ޹, Ҳ feed News server)

 innbbsd вȶ, Чʺϵͳ load Ӱ, Ҫ޸ĵĵط,
 Ҳ̫ϣͬʱ maintain dbzserver  innbbsd  source.
 (Ϊ innbbsd Ҫһ dbzserver)
 
 ܽ, ٽ innbbsd , ֳ BBS implementation
 dependend  independent ,  PBBS, Palm, Pivot,  Secret BBS ʹ.
   
======================================================================
<8>. תżܹ
[Q.1]: ɷȸ (skylark@Venus.Dorm9.nctu.edu.tw) ᵽ:
   СΪһվ(ʹ Phoenix 4.0)Ѿתųɹ
   (ʹڸ innd ʽ)Ҫ innbbsd , bbsnnrp
   ȵĳʽﵽתŵĿģڲƻ֮ǰת趨Ҫ趨
 Ѿһ news server ιŸҲҪƻҺ֮ת
   Ҫ趨

[A.1]:
ȶ, ҽ鲻Ҫ innbbsd. ȵϤ Phoenix innd , 
innbbsd Ҳٻ. 

innbbsd Ͼ Phoenix bbsinnd , ĳ֧Ԯ client gateway,
ǰ bbsinnd, ת:
1. ת history
    disable  inetd.conf  in.bntpd, kill -1 pid-of-inetd
   cd ~bbs/usr/tmp
   hisconvert history history.z > ~bbs/innd/history 
   (hisconvert  innbbsd, ~bbs/usr/tmp û history.z)
   cd ~bbs/innd
   mkhistory history 
   (innbbsd make ֮һ mkhistory ִе)
   mv history history.o
   mv history.n history
   mv history.n.dir history.dir
   mv history.n.pag history.pag
2. newsfeeds.bbs, nodename.bbs ظı.
3. nodelist.bbs ԭΪ
name          hostname & domainname                    full name
  Ϊ
name          hostname & domainname   protocol(port)   full name


ccnews        ccnews.nctu.edu.tw      IHAVE(119)       News server in CC

4. bntplink  innbbsd/innd ڵ bntplink
5. ִ innbbsd [port-no]
ֻҪ port-no ǰ in.bntpd ܵ port һ, news server κθ.

[Q.2]:
  bbs վ֮以ת(͸ news server )֪
   innbbsd ԴҪ󣬵Ҫ趨Ųƻ֮ǰת
   趨
[A.2]   
 bbs-1.domain1 bbs-2.domain2 bbs-3.domain3 벻 news server ת,
1. վ innbbsd  innbbsd  bntplink  
2. վԷԵ nodelist.bbs, 
#[nodelist.bbs]
bbs-1 bbs-1.domain1 IHAVE(7777) bbs-1 server
bbs-2 bbs-2.domain2 IHAVE(7777) bbs-2 server
bbs-3 bbs-3.domain3 IHAVE(7777) bbs-3 server
news-1 news-1.domain4 IHAVE(119) news-1 server
3. newsfeeds.bbs 趨, bbs-1.domain1  newsfeeds.bbs
   ( bbs-1 Ҳ news-1)
# newsgroup    board      server1 server2 ....
localbbs.group board-name bbs-2 bbs-3
tw.bbs.test    test       news-1 bbs-2 bbs-3 

bbs-2.domain2  newsfeeds.bbs
# newsgroup    board      server1 server2 ....
localbbs.group board-name bbs-1 bbs-3

bbs-3.domain3  newsfeeds.bbs
# newsgroup    board      server1 server2 ....
localbbs.group board-name bbs-1 bbs-2

ٶʱ bntplink. е localbbs.group ȡ, ֻҪվЭ
öܼ. 

innbbsd ĺô, bbs-1, bbs-2, bbs-3 н news server
feed, ܶ bbsnnrp ȡ news.

======================================================================
<9>.  and FAQ
--------------------
a) BBS  News Server ͬһ̨, װʱ, ǷҪرʲ ??
ֻҪ innbbsd  port 119 (nntp) Ӧû.

ע active file high, low number һҪ
10 (> 10)  digit. :
tw.bbs.test 0000000000 0000000001 y

Ϊ bbsnnrp  mmap  active file ֱ map 
memory.  digit λᱻ truncated.
й news server , Ӧþ֪Ϊ active file
е high, low ҲҪʮ digits .

Ϊ mmap,  bbsnnrp ִڼ active file ͻ
вҾ緢.  INN news server  active ĵͬ.
ͣص bbsnnrp process.

ΪԤ active , ÿ update active  backup active
activefile.BAK  activefile.BAK.OLD.
Ϊ innbbsd д history, ʹ active ,  active reset 
Ҳ޷.

 server gateway ,  bbsnnrp  " article".
 bbsnnrp  cron . Ҫ -w. ɽ newsgroups ֳ
,  tw.bbs.hot.active, tw.bbs.2ndhot.active,....
[tw.bbs.hot.active]
tw.bbs.talk.love 0000000000 0000000001 y
tw.bbs.comp.unix 0000000000 0000000001 y

[tw.bbs.2ndhot.active]
tw.bbs.admin.installbbs 0000000000 0000000001 y
tw.bbs.talk.lady 0000000000 0000000001 y

[crontab]
10,20,30,40,50 * * * * /home/bbs/innd/bbsnnrp your-news-server \
/home/bbs/innd/tw.bbs.hot.active
35 * * * * /home/bbs/innd/bbsnnrp your-news-server /home/bbs/innd/tw.bbs.hot.active

ȽҪȤ group ȡƵʸһ, ٵľ͵һ. ϵͳ load
. ÿÿ group ȡ 100 ƪ article.
( innbbsconf.h: # define MAX_ARTS 100)
--------------------
b. ûвתſɲ innbbsd.....
--------------------
innbbsd  Internet Net News .
 tw.bbs.* , Ǽ׳Ƶ TW.BBS .
 bntplink, ˫ת.
ӭ innbbsd κ, 뾯λ, innbbsd 
Խ׶. ʹ bbsnnrp ʱҲòԵ֪ news server .
--------------------
[c]. innbbsdҪҪ޸ inetd.conf services!!
innbbsd  standalone server, Բø inetd.conf  services.
ֻҪָ port number ָ default=7777.
:
1.  port 5555

 innbbsd 5555
 
   telnet localhost 5555 .
  
2.  default 7777
  
   innbbsd
   
   ÷:
   
3. ָ unix domain socket path
innbbsd 5555 /home/bbs/innd/.innbbsd.5555

ʱ local bbsnnrp 
   
bbsnnrp -p /home/bbs/innd/.innbbsd.5555 server-host active-file
      
remote bbsnnrp 
bbsnnrp -r bbs-server-hostname -p 5555 news-server-hostname active-file
         
            
innbbsd 
1. local socket
    socket file  /home/bbs/innd,   mode Ϊ 700.
2. remote access
    hostname ӵ nodelist.bbs
   
Ҫ inetd ,  inetd.conf :
innbbsd stream  tcp wait  bbs  /home/bbs/innbbsd innbbsd -i
                    ^^^^^
 service  innbbsd. رע,  "wait"  "nowait".

standalone  inetd.conf ֻѡһ.  inetd.conf ķĿǰ
вȶ, ʹ. ȶƼʹ.
--------------------
[d]. bbsnnrp Էbbs-server hostname test-news.active
     ѶϢ:
     NNRP server not ok
   
bbsnnrp һ client gateway, ʹʱһҪָһ "news server"
(ץ news  server). һ news server, 
ccnews.nctu.edu.tw (ȷ), ִ:

       bbsnnrp ccnews.nctu.edu.tw test-news.active
       
 bbsnnrp  bbs server ִʱ÷.  bbsnnrp  host
ִ,  ccsun1.cc.nctu.edu.tw, bbs server  bbs.dorm10.nctu.edu.tw,
 ccsun1.cc.nctu.edu.tw ӵ nodelist.bbs,  innbbsd,
 ccsun1.cc.nctu.edu.tw 
    bbsnnrp -r bbs.dorm10.nctu.edu.tw -p 7777 ccnews.nctu.edu.tw test-news.active   
--------------------
[e].  bbsnnrp ʱ, · BBS shutdown ʱ,  active file 
     ᲻ı?
     
bbsnnrp ʱȳ server
1. news server   (default to port nntp)
2. innbbs server (default to unix domain socket ~bbs/innd/.innbbsd or
                  -r host -p port)
߶߳ɹ bbsnnrp Żᶯ. ,  BBS server
(û innbbsd)  News server, 
bbsnnrp -r ftp.edu.tw -p 7777 ccnews.edu.tw bbs1.newsa.active
 active file ᲻ı.
--------------------
[f]. о innbbsd ϵͳҪ shutdown, עЩʲ?
     ǲСĵĻ,  innbbsd ǷӰ?
     
պд history ʱЩӰ. 򵱻ʹ
~bbs/innd/history   history.pag, history.dir һ, 
mkhistory ~bbs/innd/history  history (ͣ innbbsd).
һ history ,  history.o (Ȼؼǰ). Ŀǰ innbbsd
ж shutdown ر, ϰ
  ctlinnbbsd shutdown
     
  kill `cat /usr/tmp/innbbsd-xxxx.pid`
Ҫ kill -9 ......
 innbbsd һЩ.
  
history, history.dir  history.pag , ֱ
editor ޸.  history κǰͣ innbbsd.
--------------------
[g]. Ŀǰ dbz maintain ķʽΪ?

 innbbsconf.h 
EXPIREDAYS, HIS_MAINT_HOUR  HIS_MAINT_MIN.

ÿ EXPIREDAYS x 2 ,  HIS_MAINT_HOUR ʱ, HIS_MAINT_MIN ,
innbbsd Ὣ > EXPIREDAYS x 1.5  entries õ.
        
dbz ޸ǻ remove  entries Ĺ, ֻܴ source (history)
ҳ뱣֮ entries  rebuild dbz. Żһӵ peak load.
ѽ EXPIREDAYS, HIS_MAINT_xx ŵ innbbs.conf. 
----------------------------
[h].  Palm BBS ʹ innbbsd
Ҹոհ PalmBBS  innd-palm.tgz  Phoenix BBS  bbsinnd һ,
 post  cancel ϲ޲ͬ. Ŀǰʹ PalmBBS ߲һ⿴.
Ҫĵĵط:
1. innbbsd-0.xx/innd/bbspost.c  PalmBBS innd-palm.tgz ֮ bbspost.c
2. innbbsd-0.xx/innd/bntplink ֮ sub save_article Ϊ
########
sub save_article
{
    local       ($target) = @_;
    $now = time;
        
    open( FN, $target );
    print FN ": $poster, : $board\n";
    print FN "  : $subject\n";
    print FN "վ: $mysite ($date)\n";
    print FN "תվ: $path\n";
    print FN "\n";
    print FN @BODY;
    close( FN );
    utime $mtime, $mtime, $target;
    utime $now, $now, "$bbshome/.bcache/$board"
}
###################
            
 PalmBBS Ҳܶȡ M.xxxx.A ֮ĵ. Ȼ BBS_SRC Ҫ, bbs.h
 record.c Ҫ PalmBBS . û. Ȥ߲ѽ, 
Ҫ޸ĵ.
----------------------------
[i]. bbsnnrp ղ

1. ȷ BBS board ѿ.
2. newsfeeds.bbs, bbsname.bbs  nodelist.bbs , innbbsd .
3. innbbsd ִ uid  bbs user ͬ.
4. һ,  message, ղ,
GROUP groupname
211 1453 11644 13105 groupname
    ^^^^ ^^^^^ ^^^^^
    total low  high
        
Լ -s :   bbsnnrp -s total news-server active-file
        
ղ,  bbsnnrp -s very-large-number news-server active-file
5.  active-file format Ƿȷ
groupname high-no low-no y
6. compile ʱ BBSHOME Ƿȷ.
-----------------------------
[j]. bntplink Ͳȥ 

none (kuq.bbs@csie.nctu.edu.tw) ᵽ:
:  ҪBBS תųȥbntplink עʲ!1Թһ....ֻ
:   try to send article  ȥ תվİ濴ûתȥҮ....ʲ
:   Ⱑ!!

1. ȷõ bntplink  innbbsd .
2. ȷ nodelist.bbs ڵ news server  protocol 趨ȷ, 
   (protocol: POST(119) for client gateway)
   newsfeeds.bbs server λ nodelist.bbs .
   ȷ host  post 趨 news server Ȩ.
3.  ~bbs/out.going 
4. ת BBS վһյ,  news server ·
   ʱ޷ת.
-----------------------------
[k]. һתŵĲ,
     ҪŵĻ,  bbsnnrp -c
     Ǿͻԭеת lost ()?

A1: 
Ƚһ activefile, 
[act1]
tw.bbs.test 0000000000 0000000001 y

bbsnnrp -c news-server act1

 append act1 ƽõ activefile.
 cat act1 >> activefile
(ȷʹ activefile  bbsnnrp process)

һַ:
telnet news-server 119
group tw.bbs.test

211 27 7162 7594 tw.bbs.test
       ^^^^ ^^^^
       low  high
              
 low, high ŵ activefile
tw.bbs.test 0000007594 0000007162
            ^^^^^^^^^^ ^^^^^^^^^
            high        low
            ʮ digit
                                                  
A2:
һ reset active :
% telnet news-server 119 > tmp-active
list
quit
% grep ^tw.bbs tmp-active
 editor ֻץȤ֮ newsgroups.

-----------------------------
[l] Ҫ news server  ?
:
1.  news.active reset  0000000000 0000000001
    server,  bbsnnrp -c new-server news.active
2.  tin » server, Ƚյº server ֮Ĳ,
   ȱǰ tag (t),  pipe  bbsnnrp -t stdin
   ͨ article ʱ˳, ȱ.
   » server ½,  2 ʡ.
3.  bbsnnrp ķʽ,  server .

  ӵ 2 鷳, ,  news.active һ
   10 ,  bbsnnrp -c ܹ֮ news.active Ӧ high-no ȥ
  50  bbsnnrp .
  ( tin ȱٵ, ٸ news.active  high-no ȥ൱
   Ŀ)
   bbsnnrp -c ֮ news.active
tw.bbs.xxx 3246 1234

 tin  BBS board Ƚ, ȱ 30 ,  news.active Ϊ
tw.bbs.xxx 3200 1234
	   ^^^^^
            3246 һ 30 ൫Դ.

-----------------------------
[m] [վ] bbsnnrp Ҳ in.bntpd

ܾǰ batch file ż. 跱.
Ƽʹ innbbsd  bbsnnrp. رΪ in.bntpd ʹ.
(Phoenix BBS mfchen's bbsinnd)
innbbsd ʹߵȻҲ.

0.  BBS, in.bntpd θ. 
   bbsnnrp  BBS implementation independent.
   (ֻҪ߶ NNTP, CNEWS nntpd, INN1.4 innd, pbbsnnrpd,... Ӧö)
1. ȡ ftp.csie.nctu.edu.tw:/pub/bbs/misc/innbbsd/innbbsd-0.43.tar.gz
2. ֻҪ bbsnnrp . ɶ.
    Makefile  BBS_SRC  BBSHOME
   (û, ֻƭƭ bbsnnrp  make, һҪȷ, õ)
   make depend   (ignore any error)
   make sys-type (ѡ sys-type,  make г sys-type) 
   мκδ󶼲ù, Ҫ "bbsnnrp".
3. ͵ newsgroups,  tw.bbs.comp.mac,.... 
 activefile, ,
tw.bbs.comp.mac 0000000000 0000000001 y
.....

4.  news server (κ in.bntpd ܽ feed  host) ִ
bbsnnrp -r your-bbs-host -p bbsinnd-port news-server activefile

For example, news.cis.nctu.edu.tw  tw.bbs.talk.feeling,
tw.bbs.talk.ladytalk  bbs.cis.nctu.edu.tw (in.bntpd in port 7777),

#edit news-cis-active
tw.bbs.talk.ladytalk 0000000000 0000000001 y
tw.bbs.talk.feeling  0000000000 0000000001 y

 news.cis.nctu.edu.tw ִ
bbsnnrp -r bbs.cis.nctu.edu.tw -p 7777 news.cis.nctu.edu.tw news-cis-active

ע bbsnnrp ÿֻ 100 ,  "-a max-art"  override 
default, ܼμ.  bbsnnrp -h ɿв. 
 -r  -p ͹.

bbsnnrp ȥһЩ ~bbs/innd µ config . һЩٵƭ bbsnnrp.

һ, Ҳȫת, ֻת. bbsnnrp  ?
 "tin" , ת, иȤǰ tag ( t),
 "|", "T", "bbsnnrp -t stdin -r bbs.cis.nctu.edu.tw -p 7777"
(ʱͲָ news server  activefile)

(Ȱ mfchen post   bbsinnd ظŵ޸ patch ,
 Ҳ. ˾ͿɷֹΪ bbsnnrp ˵ظ̫) 
------------------- from mfchen@csie.nctu.edu.tw  --------------------------
ΪЧ bbsinnd ʱûмżǷظ, ·ȵ,
ܲظŵ, :

޸ inntobbs (line 73), ÿյʱǷѾ:

sub receive_article
{
    if( &find_history( $msgid ) ) {
	&bbslog( ":Err: duplicate article $msgid\n" );
        return;
    }
	 ...
 }
 -----------------------------------------------------------------------------
 ---
======================================================================
[n]. bbsnnrp  bntplink feed ʱ broken pipe ޷ feed
 boards permission mode  bbslog .  innbbsd ޷ write.
