
                       Services Server
                     (January 29, 1993)

This directory contains the source code for a freely
distributable services server.

The services server solves the following problem: for a client
process to connect to a server process, the client process must
first find out the host address and port number of the server
process.  The services server is a dynamic repository of this
address and port information.  It is an alternative to hardcoding
this information in the client process.  In other words, it acts
as a name server.

The services server allows TCP/IP server processes to advertise a
network address and port number by name, and it allows client
processes to retrieve the network address and port number of any
advertised service.  The Sun Yellow Pages and the /etc/services
Unix convention are other solutions to the same problem.

The services server is implemented using Tcl/Tk.  Tcl stands for
the Tool Command Language, a freely distributable, embeddable
scripting language.  Tk is a freely distributable X windows
toolkit and widget set implemented as Tcl commands.  Tcl/Tk and
information about Tcl/Tk are available by anonymous FTP from
sprite.berkeley.edu [128.32.150.27].

The services server also uses Tcl-DP, or Tcl Distributed
Programming, which is an extension to Tcl/Tk.  Processes that
want to connect to the services server must follow Tcl-DP remote
procedure call protocols.  Tcl-DP is not supplied in this
package, but is available by anonymous ftp from toe.berkeley.edu.

Contents of this directory:

  README		- this README file
  Makefile		- creates and installs executables
  install-scripts.tcl	- installation script used by Makefile
  services.1		- man page for executables
  services.l		- man page for Tcl/Tk procedures
  services.tcl		- autoloading Tcl/Tk procedures
  cmcap			- information on /etc/cmcap file
  swish.c		- source for swish program
  killservice.tcl	- killservice Tcl/Tk script
  lservices.tcl		- lservices Tcl/Tk script
  rmservice.tcl		- rmservice Tcl/Tk script
  serviced.tcl		- serviced Tcl/Tk script

To compile and start the services server daemon:

+) If you do not already have Tcl/Tk, get a copy and follow the
compilation instructions.  

+) If you do not already have Tcl-DP, get a copy and follow its
compilation instructions.

+) In the current directory (where this README resides), follow
the configuration instructions at the start of the Makefile.

+) Type make, which will make the swish program.  This program works 
very much like the standard Tcl/Tk wish program, but has Tcl-DP 
extensions and does not open an X window.

+) Choose a machine where you want the services server daemon
running.  This services server machine should be network
accessible to all client processes.

+) Choose an unused port number where the services server daemon
will allow client processes to connect.  For example, 2222.

+) Each machine that will run clients of the services server must
have an /etc/cmcap file, including the services server machine
you chose above.  Follow the directions in cmcap/README subdirectory 
to install these files.  Use the network address of the services server 
machine and the port number that you chose above.

+) Type make install, to finish off creation of the services
server package.  This step is important because the services
server will look for script and data files in locations defined
by you (in the Makefile).

+) Copy the file services.tcl, which is an autoloading Tcl/Tk
script, to the directory where Tcl/Tk stores your existing
autoloading Tcl/Tk scripts.  Look at the value of the TCL_LIBRARY
environment variable or in the Tcl Makefile for the pathname for 
this directory.

+) Edit the tclIndex file in that directory to include
information about the services.tcl file you just copied over.
You can also make Tcl/Tk automatically update that tclIndex file
with the "auto_mkindex" Tcl command.

+) On the services server machine, run the services server daemon
(serviced).  The services server daemon is now started and
waiting for client connections.

+) For examples of simple applications that access the services
server, see the lservices.tcl, rmservice.tcl, and killservice.tcl
Tcl/Tk scripts.

BUGS:

Periodically, the services server daemon, named "serviced," crashes
and must be restarted.
