LocalRegistry CEDAR 10.0 FOR INTERNAL XEROX USE ONLY LocalRegistry Coping with multiple instances of a service on the same machine. Mike Spreitzer, Alan Demers c Copyright 1990, 1991 Xerox Corporation. All rights reserved. Abstract: The LocalRegistry helps servers and clients find each other, and differs from most other solutions by supporting multiple instances of a service on the same machine. For example, multiple PCRs can be run on one machine, with a unique DebugNub service in each PCR --- and the LocalRegistry can keep track of them. Created by: Mike Spreitzer, Alan Demers Maintained by: Mike Spreitzer, Alan Demers Keywords: Service, Registry, Port Mapper XEROX Xerox Corporation Palo Alto Research Center 3333 Coyote Hill Road Palo Alto, California 94304 For Internal Xerox Use Only 1. General Terminology: a server is an instance of a service type. A LocalRegistry is a set of tuples, and there is a LocalRegistry on every machine. Each server is expected to maintain a tuple in the LocalRegistry of the machine on which it runs (more precisely, on each machine where it listens for connections). The property list of that tuple should include sufficient information for a client to contact the server (eg, a port number). The property list should also include information that helps a client distinguish which server, amongst all those of the same type on one machine, is the one the client wants to contact. For Servers A service type is identified by its name, and nothing more --- so please pick names that will be unique throughout all of space and time. How can the LocalRegistry reliably detect the cessation of a server? It can't. The approximation used is this: a registration lasts only for a limited time (the TimeToLive in the tuple), and each server is responsible for periodically refreshing its tuple. For Cedar servers, the LocalRegistryAgent interface provides a neatly packaged procedure, MaintainService, that takes care of everything (coping with all errors, including lack of a LocalRegistry, as best as can be done). For Cedar servers, the LocalRegistryAgentImpl catches errors, and may or may not report them. Two Cedar commands, LocalRegistryAgentVerbose and LocalRegistryAgentSilent, can change this. Currently, because use of the LocalRegistryDaemon (see below) is not ubiquitous, the LocalRegistryAgentImpl starts out not reporting errors. For Users of Client programs The UNIX program ~spreitze/lr/lrls (for LocalRegistryLS) can be used to query local registries: Command: lrls Syntax lrls ((+|-)(h|n|t|v)*)* host namePattern* +h => list handle (not default) +n => list service type name (default) +t => list time to live (not default) +v => list prop list (default) Description Lists the tuples in the LocalRegistry of the given host. If some service type name patterns are given, only the tuples for those service types are listed; otherwise, all the tuples are listed. The response `: RPC: Program not registered' means the administrator for that host hasn't yet installed a LocalRegistry. For Machine Administrators (THIS MEANS YOU!) We hope to get the LocalRegistryDaemon added to the PARC standard 4.1 configuration; until then, you have to explicitly make sure the LocalRegistryDaemon is running on your machine, if you want its service to be available. The UNIX program ~spreitze/lr/LocalRegistryDaemon implements a LocalRegistry. It forks and detaches a UNIX process to do its work, returning to the shell immediately. Until the LocalRegistryDaemon gets into the standard configuration, you can either run it explicitly after every time you boot UNIX (if we're lucky, LocalRegistryDaemon will get into the PARC standard 4.1 configuration before the next time you boot UNIX), or you can put a command to run it in your /etc/rc.local, /etc/rc.PARC, or whatever you think is best. For an example of such a command (actually a compound `if' command), look near the end of /net/augustus/etc/rc.PARC. For programs run from /etc/rc.something, it's best to make a local copy; if you run it explicitly, you can just run it from ~spreitze/lr/. 2. Commands ListRegistry [ -d ] hostname A cedar command similar in function to the UNIX command above; always lists all tuples. The -d switch prints out additional information, useful for debugging. LocalRegistryDoc.tioga Mike Spreitzer, January 14, 1991 1:39 pm PST Bier, June 20, 1990 3:53 pm PDT Michael Plass, October 24, 1991 10:11 am PDT H(cedardoc) styleNewlineDelimiter Mark LastEditedJ LastEdited,,J LastEditedJ,J LastEditedIunleaded centerHeaders K centerFooter y)Ititle Isubtitle@IauthorsIabstractms>?Ob O 'OGUO (OI boilerplate CharProps#Postfix0.63 1 0.70 textColor qo boxhead Ibodye 7R RR R R(z(_Q n block))SS&S%S SSj~ ,RR  S<