This is ndtpd.info, produced by makeinfo version 4.0 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, 1998, 1999  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: Top,  Next: Introduction,  Prev: (dir),  Up: (dir)

   This is edition 2.3.8, for NDTPD version 2.3.8.

* Menu:

* Introduction::                Introduction.
* Installation::                Installation of NDTPD.
* Configuration File::          How to write a configuration file.
* Configuration Checker::       How to check a configuration file.
* Setup Your Environment::      Setup your environment.
* Start the Server::            How to start `ndtpd'.
* Terminate and Restart::       How to terminate and restart `ndtpd'.
* Daily Works::                 Daily administrative works.
* Network License::             Network License.

* FAQ::                         Frequently Asked Questions.

 --- The Detailed Node Listing ---

Installation of NDTPD

* Basic Installation::          Basic installation.
* Compilers and Options::       Choose compilers and its options.
* Multiple Architectures::      Compile NDTPD on multiple Architectures.
* Installation Names::          Change installation Names.
* Optional Features::           Selecting optional features.
* System Type::                 Specifying the system type.
* Sharing Defaults::            Set default values for `configure'
                                scripts to share.
* Operation Controls::          Control `configure' operation.
* Optional Feature List::       Optional features this package supports.

Configuration File

* Single Directive::            Common form of single directive.
* Single Directive List::       Single directive list.
* Group Directive::             Common form of group directive.
* Book Group Directive::        Book group directive list.
* Sample Configuration::        Sample configuration file.

Configuration Checker

* Invoking ndtpcheck::          Invoking `ndtpcheck'.
* ndtpcheck Options::           Summary of options to `ndtpcheck'.

Setup Your Environment

* Services::                    Setup your `services' file.
* Syslog::                      Setup your `syslog.conf' file.
* Working Directory::           Make a working directory for NDTPD.
* Mount CD-ROM Books::          Mount your CD-ROM books.
* Appendix Data::               Copy appendix data.
* Install NDTP Client::         Installation of NDTP clients.

Start the Server

* Run as Standalone::           Run `ndtpd' as a standard daemon.
* Run as a Child of inetd::     Run `ndtpd' as a child of `inetd'.
* Checking with telnet::        Checking with `telnet'.
* ndtpd Options::               Summary of options to `ndtpd'.

Terminate and Restart the Server

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

Daily Administrative Works

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

Network License

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

Frequently Asked Questions

* 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 (`user=?' in syslog message)
* Question 5::                  Question 5 (`diclookup-mule')
* Question 6::                  Question 6 (reject any connections)
* Question 7::                  Question 7 (text stops at strange point)


File: ndtpd.info,  Node: Introduction,  Next: Installation,  Prev: Top,  Up: Top

Introduction
************

   NDTPD is a server for accessing CD-ROM books, using named NDTP
(Network Disctionary Transfer Protocol) on TCP.  You can replace
dserver with NDTPD.

   NDTPD can run on UNIX derived systems.  It supports to access CD-ROM
books of EB, EBG, EBXA, EBXA-C, S-EBXA and EPWING formats.  CD-ROM
books of those formats are popular in Japan.  Since CD-ROM books
themseves are stands on the ISO 9660 format, you can mount the discs by
the same way as other ISO 9660 discs.

   The server command is named `ndtpd'.  `ndtpd' can run as a
standalone daemon by default, but can also run as a child of `inetd'.

   NDTPD is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.

   NDTPD is distributed in the hope that it will be useful, but
_without any warranty_; without even the implied warranty of
merchantability or fitness for a particular purpose.  See the GNU
General Public License for more details.

   In addition, you must follow the licenses of your CD-ROM books.
Though NDTPD is free software, your books may not be free.  Don't open
your books to unlicensed hosts nor users.

   This edition corresponds to version 2.3.8 of NDTPD.

   You can get the latest NDTPD from
<ftp://ftp.sra.co.jp/pub/net/ndtp/ndtpd/>.

   You can get information about NDTPD from
<http://www.sra.co.jp/people/m-kasahr/ndtpd/>.

   Mail comments and bug reports to <m-kasahr@sra.co.jp> in Japanese or
English.


File: ndtpd.info,  Node: Installation,  Next: Configuration File,  Prev: Introduction,  Up: Top

Installation of NDTPD
*********************

* Menu:

* Basic Installation::          Basic installation.
* Compilers and Options::       Choose compilers and its options.
* Multiple Architectures::      Compile NDTPD on multiple Architectures.
* Installation Names::          Change installation Names.
* Optional Features::           Selecting optional features.
* System Type::                 Specifying the system type.
* Sharing Defaults::            Set default values for `configure'
                                scripts to share.
* Operation Controls::          Control `configure' operation.
* Optional Feature List::       Optional features this package supports.


File: ndtpd.info,  Node: Basic Installation,  Next: Compilers and Options,  Prev: Installation,  Up: Installation

Basic Installation
==================

   These are generic installation instructions.

   The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation.  It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions.  Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, a file
`config.cache' that saves the results of its tests to speed up
reconfiguring, and a file `config.log' containing compiler output
(useful mainly for debugging `configure').

   If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release.  If at some point `config.cache'
contains results you don't want to keep, you may remove or edit it.

   The file `configure.in' is used to create `configure' by a program
called `autoconf'.  You only need `configure.in' if you want to change
it or regenerate `configure' using a newer version of `autoconf'.

The simplest way to compile this package is:

  1. `cd' to the directory containing the package's source code and type
     `./configure' to configure the package for your system.  If you're
     using `csh' on an old version of System V, you might need to type
     `sh ./configure' instead to prevent `csh' from trying to execute
     `configure' itself.

     Running `configure' takes awhile.  While running, it prints some
     messages telling which features it is checking for.

  2. Type `make' to compile the package.

  3. Optionally, type `make check' to run any self-tests that come with
     the package.

  4. Type `make install' to install the programs and any data files and
     documentation.

  5. You can remove the program binaries and object files from the
     source code directory by typing `make clean'.  To also remove the
     files that `configure' created (so you can compile the package for
     a different kind of computer), type `make distclean'.  There is
     also a `make maintainer-clean' target, but that is intended mainly
     for the package's developers.  If you use it, you may have to get
     all sorts of other programs in order to regenerate files that came
     with the distribution.


File: ndtpd.info,  Node: Compilers and Options,  Next: Multiple Architectures,  Prev: Basic Installation,  Up: Installation

Compilers and Options
=====================

   Some systems require unusual options for compilation or linking that
the `configure' script does not know about.  You can give `configure'
initial values for variables by setting them in the environment.  Using
a Bourne-compatible shell, you can do that on the command line like
this:
     CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure

Or on systems that have the `env' program, you can do it like this:
     env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure


File: ndtpd.info,  Node: Multiple Architectures,  Next: Installation Names,  Prev: Compilers and Options,  Up: Installation

Compiling For Multiple Architectures
====================================

   You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory.  To do this, you must use a version of `make' that
supports the `VPATH' variable, such as GNU `make'.  `cd' to the
directory where you want the object files and executables to go and run
the `configure' script.  `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.

   If you have to use a `make' that does not supports the `VPATH'
variable, you have to compile the package for one architecture at a time
in the source code directory.  After you have installed the package for
one architecture, use `make distclean' before reconfiguring for another
architecture.


File: ndtpd.info,  Node: Installation Names,  Next: Optional Features,  Prev: Multiple Architectures,  Up: Installation

Installation Names
==================

   By default, `make install' will install the package's files in
`/usr/local/bin', `/usr/local/man', etc.  You can specify an
installation prefix other than `/usr/local' by giving `configure' the
option `--prefix=PATH'.

   You can specify separate installation prefixes for
architecture-specific files and architecture-independent files.  If you
give `configure' the option `--exec-prefix=PATH', the package will use
PATH as the prefix for installing programs and libraries.
Documentation and other data files will still use the regular prefix.

   In addition, if you use an unusual directory layout you can give
options like `--bindir=PATH' to specify different values for particular
kinds of files.  Run `configure --help' for a list of the directories
you can set and what kinds of files go in them.

   If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.


File: ndtpd.info,  Node: Optional Features,  Next: System Type,  Prev: Installation Names,  Up: Installation

Optional Features
=================

   Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System).  The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.

   For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.


File: ndtpd.info,  Node: System Type,  Next: Sharing Defaults,  Prev: Optional Features,  Up: Installation

Specifying the System Type
==========================

   There may be some features `configure' can not figure out
automatically, but needs to determine by the type of host the package
will run on.  Usually `configure' can figure that out, but if it prints
a message saying it can not guess the host type, give it the
`--host=TYPE' option.  TYPE can either be a short name for the system
type, such as `sun4', or a canonical name with three fields:
     CPU-COMPANY-SYSTEM

See the file `config.sub' for the possible values of each field.  If
`config.sub' isn't included in this package, then this package doesn't
need to know the host type.

   If you are building compiler tools for cross-compiling, you can also
use the `--target=TYPE' option to select the type of system they will
produce code for and the `--build=TYPE' option to select the type of
system on which you are compiling the package.


File: ndtpd.info,  Node: Sharing Defaults,  Next: Operation Controls,  Prev: System Type,  Up: Installation

Sharing Defaults
================

   If you want to set default values for `configure' scripts to share,
you can create a site shell script called `config.site' that gives
default values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists.  Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.


File: ndtpd.info,  Node: Operation Controls,  Next: Optional Feature List,  Prev: Sharing Defaults,  Up: Installation

Operation Controls
==================

   `configure' recognizes the following options to control how it
operates.

`--cache-file=FILE'
     Use and save the results of the tests in FILE instead of
     `./config.cache'.  Set FILE to `/dev/null' to disable caching, for
     debugging `configure'.

`--help'
     Print a summary of the options to `configure', and exit.

`--quiet'
`--silent'
`-q'
     Do not print messages saying which checks are being made.

`--srcdir=DIR'
     Look for the package's source code in directory DIR.  Usually
     `configure' can determine that directory automatically.

`--version'
     Print the version of Autoconf used to generate the `configure'
     script, and exit.


File: ndtpd.info,  Node: Optional Feature List,  Prev: Operation Controls,  Up: Installation

Optional Feature List
=====================

   `configure' in this package recognizes the following `--enable-' and
`--with-' options.

`--enable-ja-doc'
     Install Japanese documents.  The default value is `yes'.

`--with-logdir=DIR'
     Syslog files that `ndtpdaily' rotates by default are placed on DIR.

`--with-zlib'
     Use an installed zlib library.  This package contains source codes
     of zlib.  By default, they are compiled and linked to `ndtpd', but
     when you specify this option, an installed zlib is used.

`--with-zlib-includes=DIR'
     Look for header files of zlib installed in directory DIR.  This
     option is ignored when neither `--with-zlib' nor `--with-eb'
     option is not specified.

`--with-zlib-libraries=DIR'
     Look for zlib library files installed in directory DIR.  This
     option is ignored when neither `--with-zlib' nor `--with-eb'
     option is not specified.

`--with-eb'
     Use an installed EB library.  This package contains source codes
     of EB library.  By default, they are compiled and linked to
     `ndtpd', but when you specify this option, an installed EB library
     is used.  This option implies `--with-zlib'.

`--with-eb-includes=DIR'
     Look for header files of EB library installed in directory DIR.
     This option is ignored when the `--with-eb' option is not
     specified.

`--with-eb-libraries=DIR'
     Look for EB library files installed in directory DIR.  This option
     is ignored when the `--with-eb' option is not specified.

`--with-gnu-ld'
     Assume the C compiler uses GNU ld.  The default value is `no'.

`--enable-shared'
     Build shared library version of EB library.  The default value is
     `yes'.

`--enable-static'
     Build static library version of EB library.  The default value is
     `yes'.


File: ndtpd.info,  Node: Configuration File,  Next: Configuration Checker,  Prev: Installation,  Up: Top

Configuration File
******************

   To start `ndtpd', you have to edit a configuration file.  `ndtpd'
reads the file when it starts and restarts.  The file determines
various server behaviors.  The configuration file is
`/usr/local/etc/ndtpd.conf' by default, if NDTPD has been installed
under `/usr/local', and if a directory for read-only single-machine
data (`sysconfdir') has not been changed at the installation.  It can
be changed by the command line option `--configuration-file' (or `-c')
of `ndtpd' (*note ndtpd Options::).

   In the configuration file, blank lines and lines whose first
non-blank character is a hash (`#') are ignored.  Any other lines must
be "single directive" or "group directive".  The order of single and
group directives is not matter.

   Each line including newline character must not exceeds 511
characters.

* Menu:

* Single Directive::            Common form of single directive.
* Single Directive List::       Single directive list.
* Group Directive::             Common form of group directive.
* Book Group Directive::        Book group directive list.
* Sample Configuration::        Sample configuration file.


File: ndtpd.info,  Node: Single Directive,  Next: Single Directive List,  Prev: Configuration File,  Up: Configuration File

Common Form of Single Directive
===============================

   Single directive is a directive terminated in a line.  The common
form of a single directive is:

     DIRECTIVE-NAME    DIRECTIVE-VALUE

In the following example, `ndtp-port' is a directive name, and `2010'
is a directive value.

     ndtp-port    2010

Since directive names are case sensitive, you cannot type `NDTP-port'
instead of `ndtp-port'.  Spaces and tabs separate a directive name with
a directive value.  A sequence of spaces and tabs in the head of a
directive name and in the tail of a line are ignored.


File: ndtpd.info,  Node: Single Directive List,  Next: Group Directive,  Prev: Single Directive,  Up: Configuration File

Single Directive List
=====================

   The following single directives are recognized.

`server-name'
     The `server-name' directive specifies a hostname of the server.
     The directive is optional, and cannot be defined more than once.
     If the directive is not defined, `ndtpd' try to get a hostname
     automatically.

`ndtp-port'
     The `ndtp-port' directive specifies a port number which `ndtpd'
     binds.  The value of the directive must be a service name on TCP
     (e.g. `NDTP') or a port number (e.g. `15001').  The directive is
     ignored when `ndtpd' is invoked by `inetd'.  The directive is
     optional, and cannot be defined more than once.  The default value
     is `NDTP'.

`user'
     The `user' directive specifies an owner of `ndtpd' processes.  The
     value of the directive must be an user name (e.g. `nobody') or an
     user ID (e.g. `65535').  To change an owner to another user, you
     must start `ndtpd' process owned by `root'.  When `ndtpd' failed
     to change an owner, `ndtpd' gives up running.  The directive is
     optional, and cannot be defined more than once.  If the directive
     is not defined, the owner of the `ndtpd' process is unchanged.

     We recommend you to create a dummy user account such as `ndtpuser',
     and use it for this directive.

`group'
     The `group' directive specifies a group of `ndtpd' processes.  The
     value of the directive must be an group name (e.g. `nogroup') or a
     group ID (e.g. `65534').  The directive is optional, and cannot be
     defined more than once.  When `ndtpd' failed to change a group,
     `ndtpd' gives up running.  If the directive is not defined, the
     group ID of the `ndtpd' process is unchanged.

     We recommend you to create a dummy group account such as `ndtpgrp',
     and use it for this directive.

`max-clients'
     The `max-clients' directive specifies how many clients can be
     connected to `ndtpd' at the same time.  The value of the directive
     must be an integer not less than zero.  The directive is optional,
     and cannot be defined more than once.  The default value is `1'.
     If the value is set to `0', the limitation is disabled.

`hosts'
     The `hosts' directive specify which hosts can or cannot connect to
     `ndtpd'.  The value of the directive must be a hostname, IP
     address or ADDRESS/NETMASK pattern.  In addition, you can insert a
     leading optional exclamation mark (`!') for each pattern.  If the
     value of the directive starts with an exclamation mark, it means
     that hosts matched to the following IP address or hostsname are
     denied to connect to `ndtpd'.  Otherwise, hosts matched to the
     value are permitted to connect to `ndtpd'.


          # permit to connect from `host.xxx.yyy.jp'.
          hosts host.xxx.yyy.jp
          
          # permit to connect from `127.0.0.1'.
          hosts 127.0.0.1
          
          # deny to connect from `192.24.1.0/255.255.255.0'.
          hosts !192.24.1.0/255.255.255.0

     In a hostname pattern, you can use asterisk (`*') and question
     mark (`?').  An asterisk matches to any sequence of zero or more
     characters except for a leading exclamation mark.


          # deny to connect hosts under the `xxx.yyy.jp' domain
          hosts !*.xxx.yyy.jp
          
          # permit to connect from any hosts.
          hosts *

     An question mark represents "unknown hostname".  It matches to
     hosts whose hostname is unknown.


          # deny to connect from hosts with unknown hostname.
          hosts !?

     The `host' directive is optional, and can be defined any number of
     times.  A configuration file without `host' directive is valid,
     but nobody can connect to the server!  Please note that only one
     hostname, IP address or ADDRESS/NETMASK pattern can be defined in
     a directive.  Hosts not matched to any `hosts' directives are
     denied to connect.  When a host matches to two or more `hosts'
     directives, nearest one to the top of the configuration file is
     chosen.

     In the following example, hosts under the `sub1.xxx.yyy.jp' domain
     are denied to connect, but any other hosts under the `xxx.yyy.jp'
     domain are permitted to connect to `ndtpd'.


          hosts !*.sub1.xxx.yyy.jp
          hosts *.xxx.yyy.jp

     In this example, the order of the directives are significant.  If
     the order is reversed, all hosts under the `xxx.yyy.jp' domain
     including `sub1.xxx.yyy.jp' are permitted to connect to the server.


          # wrong!!!
          hosts *.xxx.yyy.jp
          hosts !*.sub1.xxx.yyy.jp

`timeout'
     The `timeout' directive specifies timeout seconds until `ndtpd'
     disconnects an idle connection.  The value of the directive must
     be an integer not less than zero.  The directive is optional, and
     cannot be defined more than once.  The default value is `900' (15
     minutes).  If the value is set to `0', timeout never occurs.

`ident-hosts'
     The `ident-hosts' directive specifies which of hosts
     "Identification Protocol" is used to.  Identification Protocol is
     a protocol to identify an user on a client host.  Its
     specification is described in RFC1413.  However, NDTPD supports
     this protocol for informative use only.  You cannot use it for
     user access control.

     The notation of the directive is the same as that of the `hosts'
     directive.  For hosts matched to the following pattern, `ndtpd'
     uses this protocol unless the value of the directive starts with an
     exclamation mark (`!').

     The directive is optional, and can be defined any number of times.
     The identification protocol is not used to hosts unmatched to any
     `ident-hosts' directives.  When a host matches to two or more
     `ident-hosts' directives, nearest one to the top of the
     configuration file is chosen.

`ident-timeout'
     The `ident-timeout' directive specifies timeout seconds until
     `ndtpd' gives up identifying an user on a client host by
     Identification Protocol.  The value of the directive must be an
     integer not less than zero.  The directive is optional, and cannot
     be defined more than once.  The default value is `30'.  If the
     value is set to `0', timeout never occurs.

`work-path'
     The `work-path' directive specifies the path of a working directory
     for `ndtpd' (*note Working Directory::).  The value of the
     directive must be an absolute path.  `ndtpd' creates some work
     files under the directory, and a core file is dumped at there when
     `ndtpd' aborts.  The directive is optional, and cannot be defined
     more than once.  The default value is `/usr/local/var/ndtpd', if
     NDTPD has installed under `/usr/local', and if a directory for
     modifiable single-machine data (`localstatedir') has not been
     changed at the installation.

`max-hits'
     The `max-hits' directive specifies how many hit entries `ndtpd'
     tries to find at a search.  When `ndtpd' has find the number of
     hit entries specified by the directive, `ndtpd' stops searching
     immediately.  The directive is optional, and cannot be defined
     more than once.  The default value is `50'.  If it is set to `0',
     `ndtpd' tries to find all hit entires in a subbook.

`max-text-size'
     The `max-text-size' directive restricts the maximum bytes of text
     which `ndtpd' sends to a client as a response to him.  The
     directive is optional, and cannot be defined more than once.  The
     default value is `32768'.  If it is set to `0', the size
     restriction is disabled.

`syslog-facility'
     The `syslog-facility' directive specifies a syslog facility (e.g.
     `daemon', `local0', and so on).  The directive is optional, and
     cannot be defined more than once.  The facility `daemon' is used
     by default.  Please note that syslog facility `daemon' is used
     until `ndtpd' finish reading a configuration file.


File: ndtpd.info,  Node: Group Directive,  Next: Book Group Directive,  Prev: Single Directive List,  Up: Configuration File

Group Directive
===============

   Group directive is a directive whose description is across some lines
in a configuration file.  The common form of a group directive is:

     begin GROUP-NAME
         SUB-DIRECTIVE-NAME    SUB-DIRECTIVE-VALUE
                  :
                  : (repeated)
                  :
     end

The keyword `begin' indicates the beginning of the group directive.  It
leads an argument GROUP-NAME.  They are separated by spaces or tabs,
and they must be placed in a line.  The keyword `end' indicates the end
of the group directive.  It is solely placed at a line.

   In NDTPD version 2.3.8, only `book' can be prescribed as the
group-name.  Each "sub-directive" in the group is defined between
`begin' and `end' lines.  Generic description rules about sub-directive
are the same as those of single directives; SUB-DIRECTIVE-NAME and
SUB-DIRECTIVE-VALUE are separated by space or tabs, and so on.

   This is an example of the `book' group directive.

     begin book
             name            EJDICT
             title           English Japanese Dictionary
             path            /mnt/cdrom
             hosts           127.0.0.1
             hosts           host.your.domain
     end


File: ndtpd.info,  Node: Book Group Directive,  Next: Sample Configuration,  Prev: Group Directive,  Up: Configuration File

`book' Group directive
======================

   A `book' group directive corresponds to a CD-ROM book, so that you
have to define the group directive for each CD-ROM book.  NDTPD
recognizes following sub-directives in the `book' group directives.

`name'
     The `name' sub-directive specifies a name of the book.  The value
     of the sub-directive must consist of upper letters (`A'..`Z'),
     digits (`0'..`9'), underscore (`_') and hypen (`-').  Its length
     must be up to 14 bytes.  Since the name is used to identify the
     book, each book name in a configuration file must be unique.  The
     sub-directive is required in each `book' group directive, but
     cannot be defined more than once in a group directive.

`title'
     The `title' sub-directive specifies a title of the book.  The
     value of the sub-directive can be a sequences of any characters
     except for newline and NULL (`\0') character.  Its length must be
     up to 80 bytes.  The title must be written in ISO 8859 1 or
     Japanese EUC (Extended Unix Code).  Spaces or tabs are also
     accepted and they are taken literally.

     The sub-directive is required in each `book' group directive, but
     cannot be defined more than once in a group directive.

`path'
     The `path' sub-directive specifies an absolute path to the book.
     The path must point to the top directory of the book where the file
     `CATALOG' or `CATALOGS' resides.  The sub-directive is required in
     each `book' group directive, but cannot be defined more than once
     in a group directive.

`appendix-path'
     The `appendix-path' sub-directive specifies an absolute path to
     the appendix data of the book (*note Appendix Data::).  The path
     must point to the top directory of the appendix data where the
     file `CATALOG' or `CATALOGS' resides.  The sub-directive is
     optional and cannot be defined more than once in a `book' group
     directive.  To use a book, appendix data is not required, but a
     book without appendix data may be difficult for users to read
     since some characters are unreadable.

`max-clients'
     The `max-clients' sub-directive specifies how many clients can be
     accessed to the book at the same time.  The value of the directive
     must be an integer not less than zero.  The directive is optional,
     and cannot be defined more than once in a `book' group directive.
     The default value is `1'.  If the value is set to `0', the
     limitation is disabled.

`hosts'
     The `hosts' sub-directive specifies which hosts can or cannot
     access the book.  The sub-directive is optional, and can be
     defined any number of times.  A `book' group directive without
     `hosts' sub-directive is valid, but nobody can access to the book!

     The notation is same as the `hosts' single directive.  For hosts
     matched to the following pattern, `ndtpd' permit to access this
     book unless the value of the sub-directive starts with an
     exclamation mark (`!').

     Hosts not matched to any `hosts' sub-directives in the `book'
     group directive are refused to access the book.  When a host
     matches to two or more `hosts' sub-directives, nearest one to the
     beginning of the `book' group directive is chosen.

`alias-eiwa'
`alias-waei'
`alias-kojien'
     While most NDTP clients get a book list from a server each time
     connected to the server, old NDTP clients don't do this.  Old
     clients recognize only three fixed book names; `eiwa', `waei', and
     `kojien'.  The book name `eiwa' is a name for an English-Japanese
     dictionary, `waei' is a name for a Japanese-English dictionary,
     and `kojien' is a name for a Japanese language dictionary.  Old
     clients expect that NDTP servers provide a book list of these three
     book names, but this rule is obsoleted.

     The sub-directives define `eiwa', `waei', and `kojien' as aliases
     to canonical book names for old NDTP clients.

     The value of the directives is a directory name of a subbook in the
     book.  The `ebinfo' command tells you what subbooks your book
     contains.  The `ebinfo' command has been installed at
     `/usr/local/bin', if NDTPD has been installed under `/usr/local',
     and if a directory for user executables (`bindir') has not been
     changed at the installation.  For example:

          % ebinfo /mnt/cdrom
          disc type: EB/EBG/EBXA/EBXA-C/S-EBXA
          character code: JIS X 0208
          the number of subbooks: 2
          
          subbook 1:
            title: New English Japanese Dictionary (3rd edition)
            directory: EJDICT
            search methods: word endword keyword menu
            font sizes: 16 24 30 48
            narrow font characters: 0xa121 -- 0xa24e
            wide font characters: 0xa321 -- 0xa27e
          subbook 2:
            title: How to use the book
            directory: HOWTO
            search methods: word endword keyword menu
            font sizes: 16 24 30 48
            narrow font characters:
            wide font characters: 0xa321 -- 0xa27e

     Please note that `ebinfo' doesn't read a configuration file for
     `ndtpd'.  You must specify a top directory of the CD-ROM book as
     the command line argument (*Note Invoking `ebinfo':
     (ebinfo)Invoking ebinfo, for more details about the `ebinfo'
     command).

     In this example, there are two subbooks in the book, and their
     directory names are `EJDICT' and `HOWTO'.  You can define the
     `eiwa' alias like as follows:


          alias-eiwa    EJDICT

     You can bind some aliases to a subbook, but each alias cannot be
     defined more than once in a configuration file.  These
     sub-directives are optional.


File: ndtpd.info,  Node: Sample Configuration,  Prev: Book Group Directive,  Up: Configuration File

Sample Configuration File
=========================

   The sample configuration file has been installed as
`/usr/local/etc/ndtpd.conf.sample', if NDTPD has been installed under
`/usr/local', and if a directory for read-only single-machine data
(`sysconfdir') has not been changed at the installation.

     ######################################################################
     # Configuration file for NDTPD.
     # (Copy this file to `ndtpd.conf', and edit it.)
     ######################################################################
     
     ### Hostname of the server.
     ### (default: defined automatically)
     # server-name	host.your.domain
     
     ### Port number `ndtpd' binds.
     ### (default: ndtp)
     # ndtp-port	ndtp
     
     ### Owner of the `ndtpd' process.
     ### (default: none)
     user		ndtpuser
     
     ### Group of the `ndtpd' process.
     ### (default: none)
     group		ndtpgrp
     
     ### How many clients can be connected to `ndtpd' at the same time.
     ### (default: 1)
     # max-clients	1
     
     ### Which hosts can or cannot connect to `ndtpd'.
     ### (default: none)
     hosts		127.0.0.1
     hosts		!?
     hosts		host.your.domain
     
     ### Timeout seconds until `ndtpd' disconnects an idle connection.
     ### (default: 900)
     # timeout		900
     
     ### Which of hosts Identification Protocol is used to.
     ### (default: none)
     # ident-hosts	!*
     
     ### Timeout seconds until `ndtpd' gives up identifying a remote user.
     ### (default: 30)
     # ident-timeout	30
     
     ### Path to a working directory.
     ### Please create the directory and make it be writable for the ndtpd
     ### processes before executing `ndtpd'.
     ### (default: /usr/local/var/ndtpd)
     # work-path	/usr/local/var/ndtpd
     
     ### How many hit entries `ndtpd' tries to find at a search.
     ### (default: 50)
     # max-hits	50
     
     ### Maxmimum size of text which `ndtpd' send to a client as a response
     ### to him.
     ### (default: 32768)
     # max-text-size		32768
     
     ### Syslog facility
     ### (default: daemon)
     syslog-facility	local0
     
     ###
     ### Book entry
     ###
     begin book
         ### Name of the book.
         ### (required)
         name		JITENBAN97
     
         ### Title of the book.
         ### (required)
         title		Jitenban 97
     
         ### Path to a top directory of the book.
         ### (required)
         path		/cdrom
     
         ### Path to a top directory of the appdendix data of the book.
         ### (default: none)
         appendix-path	/usr/local/share/eb/appendix/jitenban97-2.1
     
         ### How many clients can access the book at the same time.
         ### (default: 1)
         # max-clients		1
     
         ### Which hosts can or cannot access to the book.
         ### (default: none)
         hosts		127.0.0.1
         hosts		!?
         hosts		host.your.domain
     
         ### Aliases.
         ### (default: none)
         alias-eiwa		CHUJITEN
         alias-waei		CHUJITEN
         alias-kojien	IWAKOKU
     end
     
     ### Add a book group directive (lines between `begin book' and `end'),
     ### if you want to read another CD-ROM book through NDTPD.  A book group
     ### directive is required for each book.


File: ndtpd.info,  Node: Configuration Checker,  Next: Setup Your Environment,  Prev: Configuration File,  Up: Top

Configuration Checker
*********************

   To check for the configuration file you have edit, you can use the
configuration checker named `ndtpcheck'.  The `ndtpcheck' command 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.

* Menu:

* Invoking ndtpcheck::          Invoking `ndtpcheck'.
* ndtpcheck Options::           Summary of options to `ndtpcheck'.


File: ndtpd.info,  Node: Invoking ndtpcheck,  Next: ndtpcheck Options,  Prev: Configuration Checker,  Up: Configuration Checker

Invoking `ndtpcheck'
====================

   The `ndtpcheck' command reads and checks a configuration file as the
same way as `ndtpd' does.  The usual way to execute `ndtpcheck' is as
follows:

     % /usr/local/sbin/ndtpcheck

It assumes that NDTPD has been installed under `/usr/local' and if a
directory for system administrative executables (`sbindir') has not
been changed at the installation.

   If an error occurs, `ndtpcheck' outputs messages to standard error
like as follows.

     /usr/local/etc/ndtpd.conf:12: unknown user: noboy
     configuration failure


File: ndtpd.info,  Node: ndtpcheck Options,  Prev: Invoking ndtpcheck,  Up: Configuration Checker

Summary of options to `ndtpcheck'
=================================

   The `ndtpcheck' 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 `ndtpcheck' command recognizes these command line options.

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

`-d'
`--debug'
`--verbose'
     Print debugging information to standard error.  Debugging
     information shows how each line in a configuration file is
     processed.

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

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


File: ndtpd.info,  Node: Setup Your Environment,  Next: Start the Server,  Prev: Configuration Checker,  Up: Top

Setup Your Environment
**********************

   You may have to setup system environment around the server.  Super
user's priviledge may be required to do it.

* Menu:

* Services::                    Setup your `services' file.
* Syslog::                      Setup your `syslog.conf' file.
* Working Directory::           Make a working directory for NDTPD.
* Mount CD-ROM Books::          Mount your CD-ROM books.
* Appendix Data::               Copy appendix data.
* Install NDTP Client::         Installation of NDTP clients.


File: ndtpd.info,  Node: Services,  Next: Syslog,  Prev: Setup Your Environment,  Up: Setup Your Environment

`services' File
===============

   The service name `ndtp' must be added to your `services' file
(usually, `/etc/services'), if missing.  If your host runs as NIS
client, you have to edit the NIS map on the NIS server, instead.

   This line shuold be added, if missing:

     ndtp          tcp/2010

The `services' file on your system may have the `tcp/2010' line by
default, but its service name may not be `ndtp', like as following:

     search        tcp/2010

In this case, please add the service name `ndtp' to the line as an
alias:

     search        tcp/2010        ndtp

(For details, please read the manual for your system.)


File: ndtpd.info,  Node: Syslog,  Next: Working Directory,  Prev: Services,  Up: Setup Your Environment

`syslog.conf' File
==================

   `ndtpd' uses `syslog' to record logs.  Insert a line like as below
into the configuration file for `syslogd' (usually `/etc/syslog.conf').
Care must be taken not to use space to separete fields, because only
TAB is allowed in general.

     local0.info   /usr/local/var/ndtpd/log/ndtpd.log

Please remember that the syslog facility of `ndtpd' can be determined
at the `syslog-facility' directive in the configuration file for `ndtpd'
(*note `syslog-facility': Single Directive List.).

Create an empty log file if missing.

     % touch /usr/local/var/ndtpd/log/ndtpd.log
     % chmod 644 /usr/local/var/ndtpd/log/ndtpd.log

Find the PID of the running `syslogd' process.  In BSD based sytems,
type the following.

     % ps axuww | grep syslogd

In SYSV based sytems, type the following.

     % ps -ef | grep syslogd

(For details, please read the manual for your system.)
If `syslogd' is running, you can find a line like as below.

     root        63  0.0  1.1   188  316  ??  Is   10:04PM    0:00.16 syslogd

Send a hung-up signal (`SIGHUP') to `syslogd', and then `syslogd'
re-reads `syslog.conf'.

     % kill -HUP 63

If your system has the `logger' command, you can send a test message to
`syslogd' like as follows:

     % logger -p local0.info "test message"


File: ndtpd.info,  Node: Working Directory,  Next: Mount CD-ROM Books,  Prev: Syslog,  Up: Setup Your Environment

Working Directory
=================

   `ndtpd' creates some files under a working directory.  The directory
can be specified at `work-path' in the configuration file (*note
`work-path': Single Directive List.).

   Please create the directory and make it be writable for the `ndtpd'
processes and super user only.

     # mkdir /usr/local/var/ndtpd
     # chown ndtpuser /usr/local/var/ndtpd
     # chmod 755 /usr/local/var/ndtpd

It assumes that owner of `ndtpd' processes on your system is `ndtpuser'.

   Please remember that owner and group of the `ndtpd' process are
defined at the `user' and `group' directives in the configuration file
(*note `user': Single Directive List., and *note `group': Single
Directive List.).


File: ndtpd.info,  Node: Mount CD-ROM Books,  Next: Appendix Data,  Prev: Working Directory,  Up: Setup Your Environment

Mount Your CD-ROM Books
=======================

   As mentioned before, CD-ROM books themseves are stands on ISO 9660
format.  You can mount your CD-ROM books by the same way as other ISO
9660 discs.  Please read the manual for your system, if you don't know
the way of mounting ISO 9660 discs on your system.

   Please note that all letters in the file names and directory names
in a book must be unified to upper or lower case.

   `ndtpd' can access CD-ROM books compressed by `ebzip'.  See *Note
Compression: (ebzip)Compression, for more details.


File: ndtpd.info,  Node: Appendix Data,  Next: Install NDTP Client,  Prev: Mount CD-ROM Books,  Up: Setup Your Environment

Setup the Appendix Data
=======================

   Many CD-ROM books define their local characters, and they also have
bitmap data of the local characters.  NDTP didn't have a mechanism to
transfer bitmap data of the local characters to a client, but NDTPD
version 2.0 and later versions extend NDTP to transfer bitmap data.

   It is often difficult to read a book without displaying the local
characters, so that NDTPD provides "alternation text" mechanism since
version 1.0.  Using the mechanism, NDTPD substitutes the local
characters to a corresponding text.  For example, if a book defines an
equivalence mark (three parallel horizontal lines) as a local
character, NDTPD can replace the mark to the alternation text `=='.
However, CD-ROM books themselves don't have alternation text data.  You
must make the data for your CD-ROM books by yourself, or find them from
somewhere.

   NDTPD gets the alternation text data from "appendix" package.  The
appendix package provides the alternation text data and some additional
data for the corresponding CD-ROM book.  That is to say that you must
make appendix packages for your CD-ROM books by yourself, or find them
from somewhere.

   An appendix package consists of some binary files generated by the
`ebappendix' command (*note `ebappendix' Command:
(ebappendix)ebappendix Command.).  The layout of the package is similar
to that of CD-ROM book.  It has the `CATALOG' or `CATALOGS' file at the
top directory, and data for each subbook are arranged in the
corresponding sub-directory.  The path of the top directory is
specified at the `appendix-path' sub-directive in the `book' group
directive in a configuration file for `ndtpd' (*note `appendix-path':
Group Directive.).

   There are some appendix packages in the NDTPD official FTP site
(<ftp://ftp.sra.co.jp/pub/net/ndtp/ndtpd/appendix/>).

   Of course, NDTPD version 2.0 and later versions can transfer bitmap
data to clients, so that you don't always have to prepare the appendix.
However, the NDTPD extension to transfer bitmap data doesn't solve the
problem completely for the following reasons:

   * The NDTP extension can be used only when both NDTP server and
     client supports the NDTP extension.

   * Character based clients are unable to display bitmap images.

   * Transfering and displaying bitmaps within text contents cost a
     client some CPU power and memories.  Using alternation text is
     much faster and lighter.

   * Alternation text are convinient when you cut and paste contents of
     your CD-ROM book.

   It is recommended to specify `appendix-path' sub-directive for each
book if an appendix package for the book is available.


File: ndtpd.info,  Node: Install NDTP Client,  Prev: Appendix Data,  Up: Setup Your Environment

Install NDTP Client
===================

   The NDTPD distribution doesn't contain a NDTP client.  NDTPD version
2.3.8 can talk to the following clients.  Please install one or some of
these if you have not installed any client.

BookView
     BookView is a graphical client written in Tcl/Tk.  The official
     FTP site is <ftp://ftp.sra.co.jp/pub/net/ndtp/bookview/>.  The
     official WWW home page is
     <http://www.sra.co.jp/people/m-kasahr/bookview/>.

diclookup-mule
     diclookup-mule is a client running on Emacs, Mule and XEmacs.  The
     official FTP site is
     <ftp://ftp.math.s.chiba-u.ac.jp/tools/diclookup-mule/>.

Dictionary.app
     Dictionary.app is a graphical client running on NEXTSTEP and
     OPENSTEP.  The official FTP site is
     <ftp://ftp.ecip.osaka-u.ac.jp/pub/NEXTSTEP/>.

kenjiro
     kenjiro is a character based client running on UNIX derived
     systems.  Its sources are included in the dserver distribution.

     Original kenjiro cannot talk to NDTPD because of bugs in kenjiro,
     but there is a patch file to fix the bugs at
     <ftp://ftp.sra.co.jp/pub/net/ndtp/misc/kenjiro-ndtpd.diff>.
     Please apply it and install kenjiro again, if you want to use
     kenjiro.  The kenjiro applied this patch can also talk to dserver.

     Orijinal kenjiro is old type client which recognizes only three
     fixed dictionary names; `eiwa', `waei' and `kojien'.  kenjiro
     comes to recognize any book names by applying the patch at
     <ftp://ftp.sra.co.jp/pub/net/ndtp/misc/kenjiro-dictlist.diff>.

Lookup
     Lookup is a NDTP client running on Emacs, Mule and XEmacs.  The
     official WWW home page is <http://www.ring.gr.jp/openlab/lookup/>.


File: ndtpd.info,  Node: Start the Server,  Next: Terminate and Restart,  Prev: Setup Your Environment,  Up: Top

Start the Server
****************

   When you have edit the configuration file, you can start `ndtpd'.
`ndtpd' can run as a standalone daemon, or as a child process of
`inted'.  By default, `ndtpd' runs as a standalone daemon.

   If connections aren't come frequently to the server, it may be better
to run `ndtpd' as a child of `inetd' to save consumption of memory
resource.  However, each time invoked by `inetd', `ndtpd' reads a
configuration file and reads some data from CD-ROM books for
initialization.  If connections are come frequently to the server, it
may be better to run `ndtpd' as a standalone daemon.

* Menu:

* Run as Standalone::           Run `ndtpd' as a standard daemon.
* Run as a Child of inetd::     Run `ndtpd' as a child of `inetd'.
* Checking with telnet::        Checking with `telnet'.
* ndtpd Options::               Summary of options to `ndtpd'.


File: ndtpd.info,  Node: Run as Standalone,  Next: Run as a Child of inetd,  Prev: Start the Server,  Up: Start the Server

Run as a Standalone Daemon
==========================

   To start `ndtpd' as a standalone daemon, type the following command.
Super user's priviledge may be required.

     % /usr/local/sbin/ndtpd

It assumes that NDTPD has been installed under `/usr/local', and if a
directory for system administrative executables (`sbindir') has not
been changed at the installation.


File: ndtpd.info,  Node: Run as a Child of inetd,  Next: Checking with telnet,  Prev: Run as Standalone,  Up: Start the Server

Run as a Child Proccess of `inetd'
==================================

   To start `ndtpd' from `inetd', following processes are needed.  Add
the following entry to the `inetd.conf' file (usually
`/etc/inetd.conf').  Don't forget to add the `--inetd' (or `-i') option.

     ndtp  stream  tcp  nowait  root  /usr/local/sbin/ndtpd ndtpd --inetd

It assumes that NDTPD has been installed under `/usr/local' and if a
directory for system administrative executables (`sbindir') has not
been changed at the installation.

   Find the PID of the running `inetd' process.  In BSD based sytems,
type the following.

     % ps axuww | grep inetd

In SYSV based sytems, type the following.

     % ps -ef | grep inetd

(For details, please read the manual for your system.)
If `inetd' is running, you can find a line like as below.

     root        79  0.0  1.1   224  340  ??  Is   10:04PM    0:00.29 inetd

If found, send a hung-up signal (`SIGHUP') to `inetd' to re-read
`inetd.conf'.  Super user's priviledge may be required.

     % kill -HUP 79


File: ndtpd.info,  Node: Checking with telnet,  Next: ndtpd Options,  Prev: Run as a Child of inetd,  Up: Start the Server

Checking with `telnet'
======================

   When all the setup has been completed, try to connect to `ndtpd'
with the `telnet' command.

   At first, type as follows.  In this example, we try to connect to
`ndtpd' on localhost.

     % telnet localhost ndtp

The following message is displayed if `ndtpd' accepts a connection.

     Connected to localhost.
     Escape character is '^]'.

Then, tpye <t> and <Enter>.  If `ndtpd' is running correctly, it
outputs a list of available CD-ROM books like this:

     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
     $*

To close the connection, type <Q> and <Enter>.

     Q
     Connection closed by foreign host.


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/control 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.Z' is removed.

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

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

  4. The file `ndtpd.log.0' is commpress by `compress'.  It comes to
     `ndtpd.log.0.Z'.

  5. 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 (`user=?' in syslog message)
* Question 5::                  Question 5 (`diclookup-mule')
* Question 6::                  Question 6 (reject any connections)
* Question 7::                  Question 7 (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 (`user=?' in syslog message)
=======================================

Question
     Syslog messages output by `ndtpd' contains an `user' field, but it
     is always `?', like as this:

          connected: user=?, host=localhost(127.0.0.1)

     How can I get user information?

Answer
     User name is logged when Identification Protocol is enabled, and
     Identification Protocol server such as `pidentd' is running on a
     host of a NDTP client (*note `ident-hosts': Single Directive.).


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

Question 5 (`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 a 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 2.3.8
          # 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 6,  Next: Question 7,  Prev: Question 5,  Up: FAQ

Question 6 (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 7,  Prev: Question 6,  Up: FAQ

Question 7 (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.



Tag Table:
Node: Top1003
Node: Introduction4381
Node: Installation6039
Node: Basic Installation6817
Node: Compilers and Options9409
Node: Multiple Architectures10049
Node: Installation Names11026
Node: Optional Features12201
Node: System Type12962
Node: Sharing Defaults13975
Node: Operation Controls14590
Node: Optional Feature List15420
Node: Configuration File17328
Node: Single Directive18600
Node: Single Directive List19314
Node: Group Directive27448
Node: Book Group Directive28805
Node: Sample Configuration34687
Node: Configuration Checker38120
Node: Invoking ndtpcheck38751
Node: ndtpcheck Options39454
Node: Setup Your Environment40377
Node: Services41027
Node: Syslog41778
Node: Working Directory43199
Node: Mount CD-ROM Books44044
Node: Appendix Data44722
Node: Install NDTP Client47528
Node: Start the Server49326
Node: Run as Standalone50324
Node: Run as a Child of inetd50822
Node: Checking with telnet51995
Node: ndtpd Options53002
Node: Terminate and Restart54239
Node: Invoking ndtpcontrol56030
Node: ndtpcontrol Options57075
Node: Daily Works57838
Node: ndtpdaily Options59971
Node: Network License62137
Node: Count the Number of Clients63448
Node: FAQ64360
Node: Question 164966
Node: Question 265869
Node: Question 367312
Node: Question 467944
Node: Question 568539
Node: Question 670471
Node: Question 771706

End Tag Table
