Chapter 4Setting Up and Maintaining the ToolTalk Processes
Note - The ToolTalk database server program must be installed on all
machines which store files that contain ToolTalk objects or files that are
the subject of ToolTalk messages.
Location of the ToolTalk Service Files
The ToolTalk binaries and library are located in /usr/openwin with symbolic links located in /usr/dt. This
ensures that users of either Common Desktop Environment (CDE) or OpenWindows (OW) get the same version of ToolTalk. Online man
pages and ToolTalk demo program source are located in /usr/openwin.
Table 4-1 describes
the ToolTalk Service files.
Table 4-1 ToolTalk Service Files
File/location | Description |
ttsession | Communicates with other ttsessions
on the network to deliver messages. |
rpc.ttdbserverd | Stores and manages ToolTalk object
specs and information on files referenced in ToolTalk messages. |
ttcp ttmv ttrm ttrmdir
tttar | These
commands are standard operating system shell commands that inform the ToolTalk
service when files that contain ToolTalk objects or files that are the subject
of ToolTalk messages are copied, moved, or removed. |
ttdbck | A database check and recovery tool
for the ToolTalk databases. |
tt_type_comp | This is a compiler for ptypes and otypes.
It compiles the ptype and otype files and automatically installs them in the
ToolTalk Types database. |
ttce2xdr | Converts ToolTalk type data from the
Classing Engine database format to the XDR-database format. |
ttsnoop | This is a Motif application that enables
you to register ToolTalk patterns and/or send ToolTalk messages, and to generally
observe ToolTalk message traffic. It is useful both for debugging existing
applications and as a tutor in understanding how different parts of a pattern
filter incoming messages. |
tttrace | tttrace is analogous
to truss(1). It is an application that can be used in two
ways. It enables you to trace either the message-passing and pattern-matching
occurring in a given ttsession, or it can be used to provide
a per-program trace of all calls into the ToolTalk API. |
libtt.so.2 | This is the application programming
interface (API) library. |
tttk.h and tt_c.h (located in /usr/dt/include/Tt) | Header files that contain the ToolTalk
functions used by applications to send and receive messages. |
/usr/openwin/man/man1 | ToolTalk
man pages for the user commands such as ttsession, ttdbck, tt_type_comp, and so on. |
/usr/openwin/man/man1m | ToolTalk
man pages for the ToolTalk administrative commands suc such as rpc.ttdbserverd, ttdbck, and so on. |
/usr/openwin/man/man3 | ToolTalk
man pages for the ToolTalk API calls. |
/usr/openwin/man/man4 | ToolTalk
man pages for the ToolTalk message sets, and for configuration files used
for by ttsession(1) and rpc.ttdbserverd(1m) |
/usr/openwin/man/man5 | ToolTalk
man pages for the ToolTalk include files. |
ttsample, edit_demo, and Makefile (located in /usr/openwin/share/src/tooltalk/demo) | Source code for simple ToolTalk demo programs. |
Version
All ToolTalk commands support a -v option that prints
the version string.
Requirements
The software required by the ToolTalk service includes ONC RPC.
Environment Variables
This section addresss ToolTalk and related environment variables.
ToolTalk Environment Variables
There are several ToolTalk environment variables that may be set. Table 4-2 describes these variables.
Table 4-2 Environment Variables
Variable | Description |
TTSESSION_CMD | Overrides the standard options specified
when tools automatically start ttsession. If this variable
is set, all ToolTalk clients use this command to automatically start their X sessions. |
TT_ARG_TRACE_WIDTH | Defines the number of characters of argument and context values to print when
in trace mode. The default is to print the first 40 characters. |
TT_FILE | ttsession places
a pathname in this variable when a tool is invoked by a message scoped to
the defined file. |
TT_HOSTNAME_MAP | Points to
a map file. The defined map file is read into the ToolTalk client for redirecting
host machines. |
TT_PARTITION_MAP | Points to
a map file. The defined map file is read into the ToolTalk client for redirecting
file partitions. |
TT_SESSION | ttsession communicates
its session identifier to the tools that it starts. If this variable is set,
the ToolTalk client library uses its value as the default session identifier.
The string stored in this variable can be passed to tt_default_session_set. |
TT_TOKEN | Notifies the ToolTalk client library
that it has been started by ttsession; the client can then
confirm to ttsession that the start was successful. |
TT_TRACE_SCRIPT | Tells libtt to turn on client-side tracing as specified in the trace script
for tttrace(1). |
TTPATH | Tells the ToolTalk service where the ToolTalk Types databases
used by tt_type_comp(1) and rpc.ttdbserverd(1M)
reside. |
CEPATH | Tells the Classing Engine where the ToolTalk Types databases
reside. |
DISPLAY | Causes ttsession to communicate
its session identifier to the tools that it starts if the TT_SESSION variable is not set. If the DISPLAY variable
is set, the ToolTalk client library uses its value as the default session
identifier. This variable is typically set when ttsession
is auto-started while running under OpenWindows. NOTE: Under the
Solaris operating environment, this variable may not be passed across to some
accounts. That is, if you are logged on the console as User A
and switch-user to User B, ttsession
may not autostart when you attempt to run a ToolTalk program that normally
autostarts ttsession. To avoid this problem, either manually
set the this variable or include it in your .login file. |
DTMOUNTPOINT | If set, the value of this environment variable will be used in place of /net in pathnames constructed to answer tt_host_netfile_file()(3) queries, by rpc.ttdbserverd(1M). |
A process is given a modified environment when it is automatically started
by the ToolTalk service. The modified environment includes the environment
variables $TT_SESSION, $TT_TOKEN, and any contexts in the start-message
whose keyword begins with the dollar sign symbol ($). Optionally, the environment
variable $TT_FILE may also be
included in the modified environment if it is a file-scoped message.
Note - If the tt_open call will be invoked by a child
process, the parent process must propagate the modified environment to that
child process.
Other Environment Variables
The TMPDIR environment variable
is another environment variable that you can set to manipulate the ToolTalk
development environment. For example, the following line
redirects files to the /var/tmp directory.
Environment Variables Required to Start Programs on Remote Hosts
The start string is always executed on the host
on which ttsession is running; however, the executed process
can start another process on another host.
To do this, first make your start string be similar to the following:
Next, to make sure myprog is placed in the right
session and receives its initial message, you need to propagate the important
ToolTalk environment variables. The ttrsh shell script
shown in Example 4-1 propagates
these environment variables.
Example 4-1 Propagating ToolTalk Environment Variables
#! /bin/sh
# Runs a command remotely in background, by pointing stdout and stderr
# at /dev/null. By running this through the Bourne shell at the other end,
# we get rid of the rsh and rshd.
#set -x
user=
debug=
HOST=${HOST-`hostname`}
if [ "$1" = "-debug" ]; then
debug=1
shift
fi
if [ $# -lt 2 -o "$1" = "-h" -o "$1" = "-help" ];
then
echo "Usage: ttrsh [-debug] remotehost [-l username] \
remotecommand"
echo "Usage: ttrsh [-h | -help]"
exit 1
else
host=$1
shift
if test "$1" = "-l" ; then
shift
user=$1
shift
fi
fi
xhostname=`expr "$DISPLAY" : "\([^:]*\).*"`
xscreen=`expr "$DISPLAY" : "[^:]*\(.*\)"`
if test x$xscreen = x; then
xscreen=":0.0"
fi
if test x$xhostname = x -o x$xhostname = x"unix";
then
DISPLAY=$HOST$xscreen
fi
if [ "$user" = "" ]; then
userOption=""
else
userOption="-l $user"
fi
if [ $debug ]; then
outputRedirect=
else
outputRedirect='> /dev/null 2>&1 &'
fi
(
echo "OPENWINHOME=$OPENWINHOME;export OPENWINHOME;\
TT_SESSION=$TT_SESSION;export TT_SESSION;\
TT_TOKEN=$TT_TOKEN;export TT_TOKEN;TT_FILE=$TT_FILE;\
export TT_FILE;DISPLAY=$DISPLAY;export DISPLAY;($*)" \
$outputRedirect | rsh $host $userOption /bin/sh &
) &
|
|