This is ndtpd.info, produced by makeinfo version 4.2 from ndtpd.texi.

INFO-DIR-SECTION CD-ROM Book Utilities
START-INFO-DIR-ENTRY
* NDTPD: (ndtpd).               Server for accessing CD-ROM books with NDTP.
END-INFO-DIR-ENTRY

   NDTPD: NDTP server, by Motoyuki Kasahara.

   Copyright (C) 1997, 98, 99, 2000, 01  Motoyuki Kasahara

   Permission is granted to make and distribute verbatim copies of this
manual provided the copyright notice and this permission notice are
preserved on all copies.

   Permission is granted to copy and distribute modified versions of
this manual under the conditions for verbatim copying, provided that
the entire resulting derived work is distributed under the terms of a
permission notice identical to this one.

   Permission is granted to copy and distribute translations of this
manual into another language, under the above conditions for modified
versions, except that this permission notice may be stated in a
translation approved by Free Software Foundation, Inc.


File: ndtpd.info,  Node: ndtpd Options,  Prev: Checking with telnet,  Up: Start the Server

Summary of options to `ndtpd'
=============================

   `ndtpd' supports both traditional single-letter options and mnemonic
long option names.  Long option names are indicated with `--' instead
of `-'.  Abbreviations for option names are allowed as long as they are
unique.

   `ndtpd' recognizes following command line options.

`-c FILE'
`--configuration-file FILE'
     Specify a configuration file read by `ndtpd'.  The default
     filename is shown in the help message.

`-h'
`--help'
     Output help message to standard error, then exit.

`-i'
`--inetd'
     `inetd' mode.  It must be specified when `ndtpd' is invoked by
     `inetd'.

`-t'
`--test'
     Test mode.  The `ndtpd' process runs in foreground, and never
     forks.  Requests to the server are input from standard in and
     responses to a client are output to srandard out.  Standard in and
     out can be file descriptors associated with terminals.  In
     addition, access permission is never checked, so that you can
     access all CD-ROM books defined in a configuration file.

`-v'
`--version'
     Output version number to standard error, then exit.


File: ndtpd.info,  Node: Terminate and Restart,  Next: Daily Works,  Prev: Start the Server,  Up: Top

Terminate and Restart the Server
********************************

   You can use the `ndtpcontrol' command to terminate, kill and restart
the `ndtpd' precess running as a standalone daemon.  `ndtpcontrol' has
been installed at `/usr/local/sbin', if NDTPD has been installed under
`/usr/local', and if a directory for system administrative executables
(`sbindir') has not been changed at the installation.  You can
terminate the running `ndtpd' process like as follows:

     % /usr/local/sbin/ndtpcontrol terminate

   `ndtpd' logs its PID to the file `ndtpd.pid' at the working
directory (*note Working Directory::).  `ndtpcontrol' reads contents of
the PID file to get a PID of the running `ndtpd' process, and then
`ndtpcontrol' sends a signal to the PID.

   The PID file is deleted by `ndtpd' when it is terminated normally.
However, the PID file is not deleted when `ndtpd' aborts.  The PID
logged in the remained PID file will be assigned to another process, in
this case.  Be careful invoking `ndtpcontrol'.  `ndtpcontrol' doesn't
examine whether the `ndtpd' process really exists.  If the pid file is
obsolete, `ndtpcontrol' may send a signal to another process.

   `ndtpcontrol' reads the configuration file for `ndtpd' in order to
get a location of the working directory.  It can be defined at the
`work-path' single directive in the configuration file. (*note
`work-path': Single Directive List.).  The default filename of the
configuration file and default value of the `work-path' single
directive are the same as those of `ndtpd'.

* Menu:

* Invoking ndtpcontrol::        How to run `ndtpcontrol'.
* ndtpcontrol Options::         Summary of options to `ndtpcontrol'.


File: ndtpd.info,  Node: Invoking ndtpcontrol,  Next: ndtpcontrol Options,  Prev: Terminate and Restart,  Up: Terminate and Restart

Invoking `ndtpcontrol'
======================

   Its usual way to invoke `ndtpcontrol' is as follows:

     % /usr/local/sbin/ndtpcontrol SUB-COMMAND

   The `ndtpontrol' command recognizes these sub-commands.
Abbreviations for sub-command names are allowed as long as they are
unique.

`kill'
     Kill the running `ndtpd' process (send the `SIGKILL' signal).
     `ndtpcontrol' also deletes the PID file of `ndtpd'.  Before trying
     the `kill' sub-command, you should try `terminate' sub-command at
     first.

`restart'
     Restart `ndtpd' (send the `SIGHUP' signal).  The `ndtpd' process
     closes all connections, and reads a configuration file again.

`status'
     Examine whether `ndtpd' is running or not, and output the result
     to standard error.  This sub-command doesn't send any signal to
     `ndtpd'.

`terminate'
     Terminate the running `ndtpd' process (send the `SIGTERM' signal).


File: ndtpd.info,  Node: ndtpcontrol Options,  Prev: Invoking ndtpcontrol,  Up: Terminate and Restart

Summary of options to `ndtpcontrol'
===================================

   The `ndtpcontrol' command supports both traditional single-letter
options and mnemonic long option names.  Long option names are
indicated with `--' instead of `-'.  Abbreviations for option names are
allowed as long as they are unique.

   The `ndtpontrol' command recognizes these command line options.

`-c FILE'
`--configuration-file FILE'
     Specify a configuration file.  The default filename is shown in
     the help message.

`-h'
`--help'
     Output help message to standard error, then exit.

`-v'
`--version'
     Output version number to standard error, then exit.


File: ndtpd.info,  Node: Daily Works,  Next: Network License,  Prev: Terminate and Restart,  Up: Top

Daily Administrative Works
**************************

   The `ndtpdaily' command generates statistics summary from a latest
syslog file of `ndtpd', and then rotate syslog files.  The `ndtpdaily'
command mails the results to administrators specified at command line
arguments.

   The `ndtpdaily' command is a Perl script, working on perl version
4.036 or later.  `ndtpdaily' has been installed at `/usr/local/sbin',
if NDTPD has been installed under `/usr/local', and if a directory for
system administrative executables (`sbindir') has not been changed at
the installation.  Its usual way to invoke `ndtpdaily' is as follows:

     % /usr/local/sbin/ndtpdaily MAIL-ADDRESS...

For example,

     % /usr/local/sbin/ndtpdaily root@host.your.domain

Two or more mail addresses can be accepted:

     % /usr/local/sbin/ndtpdaily root@host.your.domain root@dept.your.domain


   To execute `ndtpdaily' once a day automatically, add an entry like
as follows on your `crontab'.

     0 0 * * *    /usr/local/sbin/ndtpdaily root@host.your.domain

(For details, please read the manual for your system.)
By default, `ndtpdaily' keeps 7 ages of old syslog files.  If the
current syslog file is `/usr/local/var/ndtpd/log/ndtpd.log', the old
syslog files are kept as:

     /usr/local/var/ndtpd/log/ndtpd.log.0
     /usr/local/var/ndtpd/log/ndtpd.log.1
     /usr/local/var/ndtpd/log/ndtpd.log.2
     /usr/local/var/ndtpd/log/ndtpd.log.3
     /usr/local/var/ndtpd/log/ndtpd.log.4
     /usr/local/var/ndtpd/log/ndtpd.log.5
     /usr/local/var/ndtpd/log/ndtpd.log.6

These syslog files are rotated by the following processes:

  1. The eldest syslog file `ndtpd.log.6' is removed.

  2. Other `ndtpd.log.N' files are moved to `ndtpd.log.N+1'.

  3. The current syslog file `ndtpd.log' is copied to `ndtpd.log.0'.

  4. The current syslog file `ndtpd.log' is cleared.

* Menu:

* ndtpdaily Options::           Summary of options to `ndtpdaily'.


File: ndtpd.info,  Node: ndtpdaily Options,  Prev: Daily Works,  Up: Daily Works

Summary of Options to `ndtpdaily'
=================================

   The `ndtpdaily' command supports both traditional single-letter
options and mnemonic long option names.  Long option names are
indicated with `--' instead of `-'.  Abbreviations for option names are
allowed as long as they are unique.

   The `ndtpdaily' command recognizes following command line options.

`-a INTEGER'
`--ages INTEGER'
     Keep INTEGER ages of old syslog files.  The default value is `7'.

`-c COMPRESSOR'
`--compressor COMPRESSOR'
     Specify a commpression program to compress old syslog files.  The
     COMPRESSOR must be `compress', `gzip', `bzip2' or `none'.  The
     default value is `none'.

     When `compress' is specified or no `--compressor' (`-c') option is
     specified, the `compress' command is used for compression and the
     suffix `.Z' are added to the old syslog files.  When `gzip' is
     specified, the `gzip' command is used for compression and the
     suffix `.gz' are added to the old syslog files.  When `bzip2' is
     specified, the `bzip2' command is used for compression and the
     suffix `.bz2' are added to the old syslog files.  When `none' is
     specified, no compression program is used and no suffix is added
     to the old syslog files.

`-l FILE'
`--log-file FILE'
     Specify the current syslog file.
     The default value is `/usr/local/var/ndtpd/log/ndtpd.log', if
     NDTPD has been installed under `/usr/local', and if a directory
     for modifiable single-machine data (`localstatedir') and a
     directory for log files (specified by `--with-logdir') have not
     been changed at the installation.  The default filename is shown
     in the help message.

`-h'
`--help'
     Output help message to standard error, then exit.

`-v'
`--version'
     Output version number to standard error, then exit.

`-N'
`--fast'
`--best'
     These options are passed to `gzip' and `bzip2' (*note Invoking
     `gzip': (gzip)Invoking gzip., for more details).  If neither
     `gzip' nor `bzip2' is used, these options are merely ignored.


File: ndtpd.info,  Node: Network License,  Next: FAQ,  Prev: Daily Works,  Up: Top

Network License
***************

   Some CD-ROM book publishers optionally provide network license.  It
allows multiple users on your LAN to access the book.  The license may
limit the maximum number of users accessing to the book at the same
time (since the contents of network license is various, please contact
publishers of your book for more details).

   In the configuration file of `ndtpd', there are two `max-clients'
parameters.  One is single directive (*note `max-clients': Single
Directive List.), and another is sub-directive in the `book' (*note
`max-clients': Book Group Directive.).  group directive.  Both limits
the maximum number of clients.

   They help follow the the network license, but they are not perfect.
For example, the book should be readable to an user only while his NDTP
client connects to the server, but `ndtpd' and most NDTP clients don't
frequently check whether the connection is still arive.  As the result,
users sometime thoughtlessly access the book without a connection.

   Setting `max-clients' for network license is still a good idea.  It
is important that you don't overestimate the abilities of them.

* Menu:

* Count the Number of Clients::  Count the Number of Clients.


File: ndtpd.info,  Node: Count the Number of Clients,  Prev: Network License,  Up: Network License

Count the Number of Clients
===========================

   `ndtpd' counts the number of clients accessing to a book at the time
(the `max-clients' sub-directive limits it) by the following way:

  1. When a client requests to select a book, `ndtpd' checks the number
     of clients currently accessing the book.  If it has been reached
     to the maximum value, `ndtpd' responds with an error code.
     Otherwise `ndtpd' add 1 to the number of clients that use the
     book, and responds with a success code.

     Please note that `ndtpd' never subtracts 1 to the number of
     clients of the book that the client previously selected.

  2. When a connection to a client is closed, `ndtpd' subtracts 1 to
     the number of clients of each book that the client has selected
     during the connection.


File: ndtpd.info,  Node: FAQ,  Prev: Network License,  Up: Top

Frequently Asked Questions
**************************

* Menu:

* Question 1::                  Question 1 (`ndtpd' exits immediately)
* Question 2::                  Question 2 (I cannot read my book)
* Question 3::                  Question 3 (appendix package)
* Question 4::                  Question 4 (`diclookup-mule')
* Question 5::                  Question 5 (reject any connections)
* Question 6::                  Question 6 (text stops at strange point)


File: ndtpd.info,  Node: Question 1,  Next: Question 2,  Prev: FAQ,  Up: FAQ

Question 1 (`ndtpd' exits immediately)
======================================

Question
     When I start `ndtpd', it dies immediately.  What's wrong?

Answer
     At first, please check syslog messages output by `ndtpd'.

     Most frequent cause of the problem is that `ndtpd' failed to write
     a file under the `WORK-PATH' directory.  In this case, `ndtpd'
     outputs a syslog message like as follows:

          Jun  7 22:09:50 localhost ndtpd[1760]: cannot open the file,
              Permission denied: /usr/local/var/ndtpd/ndtpd.pid
          Jun  7 22:09:50 localhost ndtpd[1760]: failed to write a PID
              to the file: /usr/local/var/ndtpd/ndtpd.pid
          Jun  7 22:09:52 localhost ndtpd[1760]: the server dies

     Please check permission, owner and group of the `work-path'
     directory.


File: ndtpd.info,  Node: Question 2,  Next: Question 3,  Prev: Question 1,  Up: FAQ

Question 2 (I cannot read my book)
==================================

Question
     I cannot read my book.  `ndtpd' is running, but `ndtpd''s behavior
     seems to be strange.  What's wrong?

Answer
     If you have compiled `ndtpd' with GCC (GNU C Compiler) version
     2.7.2 or earlier, the problem may be caused by an optimization bug
     in GCC.

     By default, the `configure' script in NDTPD generates `Makefiles'
     which gives the `-O2' option (specifying optimization level 2) to
     `gcc', but optimized object codes doesn't work correctly.

     There are three solutions of the problem:

       1. If you have another reliable C compiler, compile NDTPD with
          it.

       2. Install GCC 2.7.2.1 or later, and then compile NDTPD with it.

       3. Compile NDTPD with GCC version 2.7.2 or earlier by the
          following procedure.

          Configure the package.

               (using a Bourne-compatible shell)
               % CFLAGS='-g' ./configure

               (using a C-compatible shell)
               % setenv CFLAGS '-g'
               % ./configure

          Delete old object files (compiled with `gcc -O2') if exists.

               % make clean

          Compile the package.

               % make

          Install the programs and any data files and documentation.

               % make install


File: ndtpd.info,  Node: Question 3,  Next: Question 4,  Prev: Question 2,  Up: FAQ

Question 3 (appendix package)
=============================

Question
     I use an appendix package which is gotten from the official FTP
     site, but `ndtpd' doesn't replace local defined characters in my
     CD-ROM book correctly.  Is this a bug of `ndtpd'?

Answer
     Is the appendix package really suitable for your book?  Even if the
     title of the CD-ROM book and that of the appendix package are same,
     your book may be a later or ealier edition.  Please check ISBN code
     information in the appendix package, if exists.


File: ndtpd.info,  Node: Question 4,  Next: Question 5,  Prev: Question 3,  Up: FAQ

Question 4 (`diclookup-mule')
=============================

Question
     I use `diclookup-mule' as NDTP client.  I can use `Shin Eiwa Waei
     Chujiten' and `Kojien' correctly, but cannot use other books.  Is
     this a bug of NDTPD or `diclookup-mule'?

Answer
     `diclookup-mule' is old type client.  Old NDTP clients including
     `diclookup-mule' don't get a book list from an NDTP server.  They
     uses only three book names `eiwa', `waei' and `kojien' (*note
     `alias-eiwa' and `alias-waei' and `alias-kojien': Book Group
     Directive.).  However, `diclookup-mule' locally defines some book
     names; the book name `oxford' for `the Oxford English Dictinary',
     `crger' for the `Crown German Japenese dictionary', and so on.

     `ndtpd' doesn't recognize these local book names defined by
     `diclookup-mule'.  To resolve the problem, please modify the local
     names to names which `ndtpd' can recognize.

     At first, check a book list of `ndtpd' on your system.  Invoke
     `ndtpd' with the `--test' option.

          % ndtpd --test
          # ndtpd version 3.1.5
          # test mode (type `Q' to quit)

     Then, tpye <t> and <Enter>.

          t
          1   Oxford Dictionary/Thesaurus   edict/oxford   0   0   0
          2   Quick Tour                    edict/quick    0   0   0
          3   User's Guide                  edict/user     0   0   0
          4   About This Disc               edict/about    0   0   0
          $*

     Type <Q> and <Enter> to quit the test mode.

          Q

     In this example, `Oxford Dictionary/Thesaurus' is bound to the
     book name `edict/oxford'.  Then, please modify `lib/od-oxford.el'
     in `diclookup-mule', like this:

          (od-modify-dict-parameters
           "edict/oxford"
           (cons

     Then, install `diclookup-mule' again.


File: ndtpd.info,  Node: Question 5,  Next: Question 6,  Prev: Question 4,  Up: FAQ

Question 5 (reject any connections)
===================================

Question
     I have setup the `hosts' single directives in `ndtpd.conf'
     correctly, but `ndtpd' running on my NEXTSTEP and OPENSTEP machines
     reject any connections to clients.  Why?

Answer
     When `ndtpd' establishes a connection to your client, it tries to
     lock a lock-file to limit the number of NDTP connections (*note
     `max-clients': Single Directive List.).  However, `ndtpd' on
     NEXTSTEP and OPENSTEP always fail the lock.  (To lock the file,
     `ndtpd' calls `fcntl()' with the `F_SETLK' parameter, but it
     doesn't seem it works correctly.)

     If `ndtpd' fails to lock, it assumes that the number of connected
     clients is reached to its limit, and it gives up establishing the
     new connection.  That is the reason why `ndtpd' on NEXTSTEP and
     OPENSTEP reject any connections.

     To avoid this problem, please defines all `max-clients' single
     directives and sub-directives in the `book' group directive, and
     set their values to `0'.  (if the directive is missed, `ndtpd'
     assumes that `1' is specified.)


File: ndtpd.info,  Node: Question 6,  Prev: Question 5,  Up: FAQ

Question 6 (text stops at strange point)
========================================

Question
     NDTPD stops sending text at strange point.  How do I solve the
     problem?

Answer
     This problem is caused because your CD-ROM book uses unusual code
     for text delimiter.  If an appendix package for your CD-ROM book
     is available, please use it.  Appendix package defines appropriate
     stop-code for your CD-ROM book.

     If appendix package doesn't exist, please contact the maintainers
     of NDTPD.


