
Addhost 2.0 Installation instructions.  This file gives instructions
for configuring the 'Makefile' file and installing addhost.

SunOS 4.1.x - addhost 2.0 was developed on a sun, so has been tested
most strenuously on this platform.

Ultrix V4.1 (Rev. 38), DS3100 - it was necessary to compile the BSD
curses library and link addhost with that instead of using the curses
library that came with Ultrix.

Haven't tried any other systems.


BASEDIR is where all the software and man pages will go.  I suggest not
changing the BASEDIR from /usr/local/addhost, but simply make a link to
where you have room for the executables, man pages, and database.  If
you wanted to put it in /var/addhost for example, then do this before
running "make":
   ln -s /usr/local/addhost /var/addhost
   mkdir /var/addhost

DESTETC is where addhostd goes.  For addhostd to serve connections from
dumphost, the following line should be added to "/etc/inetd.conf".
   addhostd stream tcp nowait addhost /usr/local/addhost/etc/addhostd addhostd

LIBDIR is where the configuration, security, and database files go.

USRMAN is where the man pages go.

RECLOCKDIR is where lock files for existing records are created.
Record lock files only contain the username of the user running
addhost, so don't get worried about space, this shouldn't be a
problem.

DBDIR is where the database is kept.  The space needed for this
directory is directly proportional to the size of your addhost record
and the number of records.  You should put this on a partition that has
enough space to suit your needs.  I don't see any reason to separate
the software and the database, but you can change this variable to do
this if you like.

DBLOCKDIR is where locks corresponding to the pid of each user running
an addhost process are kept.  Like record locks, the files only contain
a username, so a lot of space isn't necessary for this.

ADDPROG is the name of the program used to interactively add records
to the database.

RMPROG is the name of the program used to interactively remove records
from the database.

BADPROG is the name of the program used to add records to the database
in batch mode.

BRMPROG is the name of the program used to remove records from the
database in batch mode.

DAEMONPROG is the name of the daemon program used to give out
information to the DUMPPROG.  This line should be added to
"/etc/services".  Use whatever port number is appropriate or available
for your site.
   addhost 811/tcp addhostd

DUMPPROG is the name of the program that connects to DAEMONPROG to get
information in bulk form from the database for use in creating the
hosts file or nameserver files, etc.

A user named "addhost" should be created to own the database and other
files in the lib directory.  This way, the addhost program can run as
setuid "addhost" rather than setuid "root" as it has previously been
done.  The following line should then be added to one of the rc files
for when the machine reboots.
   su addhost -c '/usr/local/addhost/bin/addhost -clean'
Note that the default addhosers file installed when you type "make
install_all" contains the line "all addhost".

USER is the owner that the addhost program is installed under, with the
setuid bit set.  If you didn't create a user named "addhost", then
change this.

GROUP is the group ownership that the files in the LIBDIR are installed
under.  If you don't have an "addhost" group, then change this.

Addhost can be compiled to log information to syslog or to a log file
or both.  Check "common.h" and set the SYSLOG and or LOGTOFILE
variables accordingly.  If SYSLOG is set to 1, then /etc/syslog.conf
should be set up to log to the appropriate places.  the default for
addhost is to use LOG_LOCAL7, this may already be used at your site, so
you may need to change this in the header file.  Here's an example line
for your syslog.conf file.
   local7.info /var/adm/addhostlog

Look in the dumphost subdirectory and modify Makefile variables to
what is desired.

After reading through all the above information and performing the
required actions, you can
   - type `make clean'               (for old object files and executables)
   - type `make depend'              (should only need to do this once)
   - type `make install_all' as root (for first-time install)
   - type `make install' as root     (don't step on configuration files)

After reading through the man pages provided, so as to understand more
about what addhost is doing, you need to modify the configuration files
in LIBDIR to suit your site.  These are "db.keys", "db.fields",
"screen.conf", "addhosers", and "radhosts".  You may also need to
modify the "fields.hf" to give your users help on the fields specific
to your site.

Once you're comfortable with your configuration changes, you need to
commit the changes by doing
   addhost -init
This reads "db.keys", "db.fields", and "screen.conf" and re-writes
them out to the same name but with a "." on the front if the files
don't have any syntax errors in them.

If you get this far, you should be able to start adding, removing,
modifying records in the database.

Before putting the database into full swing, you should set up a
nightly cron job to back up the database.  It's best to have this
backup done to another machine, 2 machines would be even safer.  The
backup is to insure that your data is recoverable even if your addhost
machine crashes or you find a bug in addhost that I didn't know about.
The "mkhostsbackup" script in the tools directory is what I use.  There
are other example scripts in that directory as well.

