Tape Server installation for Linux

The Tape Server package is a complete tar archive and includes the 4 process modules (master task, driver task, stats task and link task).
The Tape Server Link task is a RPC server for the data transfer procedure (proc 31 of edoc410).

Installation

The following instructions assume that the base of your MIDAS installation is /MIDAS.
Uppack the Tape Server package archive into /MIDAS. This will create directories /MIDAS/TapeServer and /MIDAS/TapeServer/Linux. The tape server process modules will be found in /MIDAS/TapeServer/Linux.
Become super user and make /MIDAS/TapeServer/Linux your current directory. Change the owner of the executable files to root and the access permissions to -rwsr-sr-x. This is important. It permits the Tape Server master task to raise itself and its child processes into the Real Time scheduling class. Also the driver task can perform certain essential operations on the /dev/rmt device. Normal users can now start and terminate/kill the tape server without additional privileges.

NOTE - The Linux version is now made using gcc 4.1.1 with RedHat Enterprise Workstation 5 and kernel 2.6.18. A version made using gcc 2.95 and Debian 3.0r2 is available in the directory DebianLinux. These differ only in the libraries which are required since some current releases of Linux no longer install the libraries needed by gcc version 2.96.

The MessageLogger client interface library has now been static linked into the modules so that no libraries other than standard system libraries are required.

Create a directory /MIDAS/config/TS_10205 (the _10205 is important!). Be careful with permissions since the tape server master will create a file in the directory. In this new directory create a file /MIDAS/config/TS_10205/TS_configuration which will look like this:

#device configuration information
#    any line starting with a # is a comment and is ignored
stats  /MIDAS/TapeServer/Linux/stats
#    devices available   -   list ends with a null line or a line starting with a & character
#    format       class_name     device_name    driver_task_path_name
#       class_name MUST be one of dlt, exabyte, scsitape, file or sink
#       driver_task_path_name normally is omitted
dlt           /dev/nst0    /MIDAS/TapeServer/Linux/driver
exabyte       /dev/nst1    /MIDAS/TapeServer/Linux/driver
sink          /dev/null/0    /MIDAS/TapeServer/Linux/driver
file          /dev/file/0    /MIDAS/TapeServer/Linux/driver
&
#data link configuration information  - list end with a null line
#    format   link_task_path_name    list of ports to listen on
/MIDAS/TapeServer/Linux/linkTCP
&
#program options - list end with a null line
msg_reporting_level 0x0180fff8
#   use 0x0080fff8 to enable msg logging
msg_logging_level 0xfff8
#    enable data compression to disc
tapeserver_options 0x2
#    default for following is 16Kbytes - both MUST be the same at present
data_buffer_size 16
tape_block_size 16
disc_file_size 2000
#
file_path_base  /space/TapeData
&
#end of information

This defines a DLT tape drive using /dev/st0 and a Exabyte tape drive using /dev/st1. Change these or add for your hardware.
The Tape Server working directory which contains the configuration file may be specified by the environment variable MIDASTSBASE (highest priority) or the environment variable MIDASBASE. Using MIDASTSBASE would be useful if several copies of the Tape Server are run in a shared environment.
The program options data_buffer_size and tape_block_size may be expressed in bytes or Kbytes. In the current release they SHOULD have the same value. The default value is 16 and both may be omitted if data blocks of 16Kbytes are being used. The values MUST be compatible with the data source being used.
The program option file_path_base is the root directory used by the file device. It may be omitted if the file device is not used.

To start the tape server:

cd /MIDAS/TapeServer/Linux
./master

This command causes the Tape Server master task to be started. The master task will then start the required driver and link tasks using the information in the configuration file. If started this way you can kill the master task and all the tasks started by the master using Control+C.

You will get a lot of logging messages. Look for messages like:

MIDAS Tape Server: Configuration: UDP port = 10205, SHM key=10205.
MIDAS Tape Server: Shared memory ID is 65
MIDAS Tape Server: Shared memory segment located at address ff070000.
MIDAS Tape Server: Configuration file used - /MIDAS/config/TS_10205/TS_configuration
MIDAS Tape Server: Using device dlt /dev/rmt/1 ./driver
MIDAS Tape Server: Data link ./link
MIDAS Tape Server: Master global area initialised.
MIDAS Tape Server: Driver process for /dev/rmt/1 has pid 14409
MIDAS Tape Server: Link task has pid 14413
MIDAS Tape Server: Starting the RPC interface
MIDAS Tape Server: Created RPC Program 28000205 Version 4 on UDP port 10205.
MIDAS Tape Server: Entering server loop
MIDAS Data Link (14413): Message logger contacted.
MIDAS Data Link (14413): Started with args 10205 10305 0
MIDAS Data Link (14413): Configuration: SHM key=10205, UDP port = 10305, stream=0
MIDAS Data Link (14413): Shared memory ID is 65
MIDAS Data Link (14413): Shared memory segment located at address ff070000.
MIDAS Data Link (14413): Starting the RPC interface
MIDAS Data Link (14413): Created RPC Program 28000205 Version 4 on UDP port 10305.
MIDAS Data Link (14413): Entering server loop
MIDAS Tape Driver (14412): Configuration: driver=0, key=10205.
MIDAS Tape Driver (14412): Shared memory ID is 65
MIDAS Tape Driver (14412): Shared memory segment located at address ff070000.
MIDAS Tape Driver (14412): Using device /dev/null/1 of type dlt.
You will now have to attach the Tape Server to your experiment. Use the Apparatus Control button in Experiment Access and select the tape options. The master task creates a file /MIDAS/config/TS_10205/TS_capabilities where it stores issued capabilities which are reloaded whenever the tape server is started.
You can use the Tape Server GUI to claim a drive, mount/identify a tape and open a file in the normal way.

The port 10205 in the apparatus file matches up with the TS_10205 directory. If you wish to run a second (or further) copy of the Tape Server in the same system repeat the installation instructions changing 10205 for 10206 etc.
The Link task listens for incoming data on the ports 10305, 10306 etc.

 return to MIDAS download home page