The following sections are intended as a guide through the process of setting up the clients for any OLxx service. If you have questions about any of this, please let me know, and I'll attempt to make it clearer.
service "NAME"
fallback_server "server.host.name"
server "server.host.name"
prompt "text> "
answer_client
no_hours
consultant_title "title"
help_dir "/path/to/help"
help_ext ".ext"
help_name "help_file"
stock_browser "/path/to/browser"
stock_dir "/path/to/stock/answers"
stock_attach "command"
stock_magic "/path/to/MAGIC"
help command
/usr/athena/lib/olc/olc.cfg and
/usr/athena/lib/olc/olcr.cfg, which are the configuration
files for olc and olcr, respectively. Later
sections contain information on testing your
configuration file and putting it into
production.
configuration_keywordor
configuration_keyword "string argument"Blank lines are ignored. Any line starting with
# will
is a comment and will be ignored. (Note that the comment must start
the line and may not appear following a configuration
keyword on the same line.)Unless otherwise noted, any particular configuration keyword should appear at most once in the configuration file. Here is a list of all keywords:
service "NAME"
service "OWL"
This keyword is required for normal operation of the client.
fallback_server "server.host.name"
fallback_server "matisse.mit.edu"
This keyword is avaliable if the client uses Hesiod (always true on Athena). In that case, it is needed for normal operation of the client if the network experiences problems.
server "server.host.name"
server "matisse.impressionists.org"
This keyword is avaliable if the client does not use Hesiod (never true on Athena). In that case, it is needed for normal operation of the client.
prompt "text> "
-prompt command-line flag.
prompt "owl : "
If this keyword isn't specified, the prompt defaults to the name of
the configuration file used, followed by a greater-than sign and a
single space (e.g. "owl> ").
answer_client
no_hours
hours command is disabled.
consultant_title "title"
consultant_title "Pontifex Maximus"
This keyword is required for normal operation of the client.
help_dir "/path/to/help"
help_dir "/usr/athena/lib/olc/olc_help"
This keyword is required for help to work.
help_ext ".ext"
help_ext ".help"
If no extension is specified, ".help" is used.
help_name "help_file"
help is used with
no arguments.
(See the discussion of OLC client help.)
help_name "olc"
If no name is specified, the name of the configuration file is used, which may not be what you want.
stock_browser "/path/to/browser"
stock_browser "/mit/library/browser"
This keyword is required if the service has any stock answers.
stock_dir "/path/to/stock/answers"
stock_dir "/mit/library/stock_answers"
This keyword is required if the service has any stock answers.
stock_attach "command"
stock_attach "/bin/athena/attach library"
This keyword can be omitted if the stock answers are always available.
stock_magic "/path/to/MAGIC"
stock_attach (if any) are executed; if the file still
isn't accessible, the stock answers are assumed to be unavailable.
stock_magic "/mit/library/MAGIC"
This keyword is required if the service has any stock answers.
(Even if your stock answers are available without running any special
commands via stock_attach.)
help commandhelp command.
However, at the time of writing, all OLxx services (olc,
olta and owl) used the help files for
olc. This means that help for olta actually
refers to "olc", but presumably the user can figure out what is going
on.
If you want to set up your own set of help pages, you can configure
their location and filenames using the
help_dir,
help_name and
help_ext
configuration keywords. (You could do as little as replacing all
occurrences of "olc" with the name of your OLxx service; Emacs
search-and-replace should get the capitalization right.)
If you want to avoid customizing the help pages, you can use the help pages from the system packs by setting
help_dir "/usr/athena/lib/olc/olc_help" help_ext ".help"as well as
help_name "olc"for your user client and
help_name "olcr"for the consulting client. Note that, in this case, you need to specify "olc" and "olcr" in place of the actual names of your clients, because help files named after your service won't be available on the system packs.
answers
command (also known as stock), which enables the user to
browse a tree of "stock" answers to commonly asked questions.
Of course, you will need to generate a stock answer tree, which goes
beyond the scope of this document (and to the best of my knowledge
isn't really documented anywhere). The root of the stock answer tree
should be specified by the stock_dir keyword.
The stock_magic keyword must be used to specify the
location of a file which will be available when the stock answers are.
This should be a file in the same locker as the stock answer tree, or
(if the files live on local disk) a file on the same disk partition.
On Athena, this file is traditionally named
/mit/lockername/MAGIC.
If the tree lives in a locker, you should also use the
stock_attach keyword to specify the command(s) to attach
the locker.
In addition, you will need a configured OLxx
browser, the path to which should be specified using
stock_browser.
olxyz.cfg, where
olxyz is whatever name you have chosen for the
client. From the directory where the configuration file lives, run:
olc -config . -name olxyzThe
-config flag specifies a directory (or a
colon-separated list of directories) that will be searched for the
configuration file. On Athena, this defaults to
/usr/athena/lib/olc:/mit/olta/config:/mit/library/configThe
-name flag specifies the name of the configuration
file to be found, with the .cfg extension removed. By
default, this is the same as the name by which the client was invoked.The client invoked in this way should work just as you would expect it to work when it actually gets installed. The only difference is that it may not find the OLC browser, or may use the old one, until you actually deal with the installation of the browser.
olc with the appropriate arguments.There are several Athena-specific issues to be considered at this point. If your client only needs to run on supported Athena platforms with release 8.1 or later, the script may be reducible to a single line, but otherwise, you should probably consider the following:
olc binary on these platforms has no configuration
support. If you wish to support these machines for the time being,
you should either run previously compiled client binaries or provide
configurable binaries on your own.
olc
binary won't be configurable, and provide your own as above.
/usr/athena/bin/olc on an
Athena machine has configuration support is to check for existence of
the configuration files, for example /usr/athena/lib/olc/olc.cfg.
Finally, you can use symlinks to make the same script be used for the user and consulting clients, making maintenance a little simpler in the long run. The final result might look something like this:
#!/bin/sh
# invocation script for olxyz and olxyzr
program=`basename $0`
if [ -f "/usr/athena/lib/olc/olc.cfg" ]; then
# olc.cfg found, assuming /usr/athena/bin/olc is configurable.
exec /usr/athena/bin/olc -config /mit/olxyz/config -name "$program" ${1+"$@"}
else
BINARY="`/usr/athena/bin/athdir /mit/olxyz libexec`/$program"
if [ -f "${BINARY}" ]; then
# no configuration, but we have a non-configuration binary.
exec ${BINARY} ${1+"$@"}
else
# oops, no binary found.
echo "$program binary for this platform not found." >&2
exit 1
fi
fi
.cfg extension). Since the invocation name of the
binary is the default value for the -name parameter, the
binary will correctly find the configuration file and everything will
work fine.This is not recommended on Athena, due to the complications listed in the previous section.
olc_browser is in
/usr/athena/lib/olc/olc_browser.cfg, which shouldn't come
as a surprise if you've read chapter 1.The general format of the configuration file is the same as for the client configuration, but the configuration commands are different (and fewer):
root_dir "/path/to/stock/answers"
stock_dir in the client configuration will be used, but
we need this in case the browser is invoked stand-alone.
root_dir "/mit/library/stock_answers"
This keyword is required for normal operation of the browser.
header "Header Line For Browser"
header "On-Line Librarian Browser"
Use of this keyword is optional, but encouraged.
prompt "text> "
prompt "owl_browser> "
If this keyword isn't specified, the prompt defaults to
"browser> ".
olxyz_browser.cfg, where
olxyz_browser is whatever name you have chosen
for the client. From the directory where the configuration file
lives, run:
olc_browser -C . -N olxyz_browser -r /mit/olxyz/stock_answersThe
-C and -N flags behave like
-config and -name in the browser: the former
specifies a directory (or a colon-separated list of directories) that
will be searched for the configuration file, and the latter, the name
of the configuration file. On Athena, the directories searched default
to
/usr/athena/lib/olc:/mit/olta/config:/mit/library/config
Here is an Athena-centric example of a wrapper script. The only
differences from the example above is that -config and
-name were replaced by their counterparts,
-C and -N.
#!/bin/sh
# invocation script for olxyz_browser
program=`basename $0`
if [ -f "/usr/athena/lib/olc/olc.cfg" ]; then
# olc.cfg found, assuming /usr/athena/bin/olc is configurable.
exec /usr/athena/bin/olc -C /mit/olxyz/config -N "$program" ${1+"$@"}
else
BINARY="`/usr/athena/bin/athdir /mit/olxyz libexec`/$program"
if [ -f "${BINARY}" ]; then
# no configuration, but we have a non-configuration binary.
exec ${BINARY} ${1+"$@"}
else
# oops, no binary found.
echo "$program binary for this platform not found." >&2
exit 1
fi
fi
Errors on these pages (and bugs in OLC) should be reported to <olcdev@mit.edu>.