Tclient and tclientd are the processes which form either end of the
network link: on one end, tclient reads/writes data from /dev/sdev
(or whatever you call the corresponding device), and sends the data over
a socket connection to tclientd on the system which has the actual
tape drive.
When tclient is invoked, it acquires a socket, then uses rsh to invoke
tclientd on the other system. You need to set things up so this is
possible by adding appropriate entries in your .rhosts file. Tclientd
opens a socket connection back to tclient, and waits for traffic.
The tclient syntax is:
tclient devicename hostname rsystype lsystype rdevname srchost debug
where:
- devicename
- is the server side paired device to open,
e.g. "/dev/rmt80.server"
- hostname
- is the server hostname, e.g. mead1
- rsystype
- is the server system type, e.g. AIX or DECOSF
- lsystype
- is the local system type, e.g. AIX or DECOSF
if rsystype==lsystype, no errno/ioctl mapping is done
if either type==UNKNOWN a warning is issued and no mapping is done
if the two types are different but known, the errno and ioctl calls are mapped
- rdevname
- is the device name that the invoked server
(tclientd) on hostname should open.
- srchost
- is the hostname the rsh'd daemon should respond to,
i.e. our hostname, possibly with a suffix (mead1b,
for example).
- debug
- is optional; if specified as 'debug', trace info
will be printed (and the debug option will be passed to
tclientd).
If this seems like an awkward syntax, you are right. Here at the UW,
tclient is always invoked by a program (part of our TMR tape mount system),
so a user friendly syntax wasn't a priority.
Example:
- tclient /dev/sdev mead1 AIX DECOSF /dev/rmt0 saul2b
The situation here is that you are on a dec machine called saul2b, and
the server side pseudo-device is /dev/sdev. You want to connect to
an aix machine called mead1, and use real drive /dev/rmt0.
The tclientd syntax is:
tclientd rdevicename srchost port debug
where:
- rdevicename
- is the name of the drive to use on the server
machine, e.g. '/dev/rmt0'. tclientd assumes
that the device has already been chown'd.
- srchost
- is the name of the host that we should connect
back to.
- port
- is the port to connect to.
- debug
- is the only optional argument: if specified as
'debug' trace info will be printed to stdout.
In general, the tclientd syntax is irrelevant - tclient invokes tclientd.
Note that the debug option can be toggled on and off while tclient
is running by sending a SIGUSR1 signal ('kill -USR1 ....').
Tclientd is packaged as a single source file - tclientd.c. Tclient is
built from 4 source files:
- tclient.c is the main routine
- tcopen.c establishes the network connections and starts tclientd.
- tcsendrecv.c performs the actual reads and writes on the socket.
- tcerrno.c maps errno values from differing operating system types.
The communications between tclientd and tclientd involve the exchange of a
a fixed length header (struct devblok) and a variable length data section.