next up previous contents
Next: NFS-Mounting Your File System Up: Configuring and Running the Server Previous: Configuring a Shore Server

Subsections
 

Running a Shore Server

 

A Bootstrapping Problem

When the server starts, it locates its configuration file and reads it. The configuration option svas_root gives a pathname in the Unix file system of a device or file that is to serve as the root volume for Shore. The default is ./volumes/miniroot 10, which means that Shore will use the Unix file ./volumes/miniroot to simulate a disk device. (The "10" is an internal volume id to be assigned to this volume by Shore). Using Unix files to simulate disks is convenient for debugging, but for better performance, you should replace this name with the pathname of a real "raw" disk device (/dev/...). One or more options svas_serve may also be present, indicating other devices containing volumes to be served. When you start from scratch, you have no root directory, and you have to create one. The server is able to run without a root directory, but you can't do much with a server that has no file system, other than use it to format devices and make file systems (which correspond to volumes) on those devices.

After reading the configuration file, the server normally starts a TCL shell. TCL (Tool Command Language) is a package originally written by John Ousterhout at the University of California at Berkeley. It consists of an interpreted language and an extensive support library, including facilities for calling C function from TCL. The main use of TCL in Shore is to provide an interactive command-line interface to its components. The TCL shell started by the SVAS reads a script of start-up commands and then prompts for interactive input.

 

TCL command file (option svas_shellrc)

One of the configuration options, svas_tclshell, determines whether the server will start a TCL shell. If the value of svas_tclshell is yes or true, a shell is started, and the option svas_shellrc is inspected. (If the svas_tclshell option is not set by the configuration file or a command-line option, its default value is true.) If svas_shellrc is set, it names a file of TCL commands, which are interpreted when the shell starts. The default configuration file included with Shore sets this option to  /shore.rc. If you followed the installation instructions, you copied shore.rc from the installation directory $SHORE/lib to your home directory. This file of TCL commands is a convenience, not a requirement. You may modify it or even remove it once you understand what it does.

The first time you run the SVAS, you are doing the Shore counterpart of re-installing Unix. The analogous activity in Unix is to reformat your disks and install Unix from scratch, making file systems with mkfs(8) or newfs(8)). There are enough steps to this process that you don't want to have to do it by hand each time. The script shore.rc automates this task. It determines if the root file system was mounted when the server started running. If not, the TCL commands format the root volume and create a Shore file system on it. The commands also create several directories that are required by the example applications.

Once your system is configured and running, and you are in "production mode", you can dispense with this script. As long as you don't intend to reformat your disks, you can start a server without an TCL commands; all you have to do in this case is to set the SVAS options svas_root and svas_serve so that the SVAS can mount the root directory and other volumes. On the other hand, it does not hurt anything to run the server with a TCL shell and to have it read the TCL command file each time it starts. If you want to replace the file of TCL commands with your own version, or if you want to avoid reading such a file altogether, edit your options file .shoreconfig and change or remove the command that sets the option svas_shellrc.

 

Running the Shore Server

If you followed the instruction for running the SVAS in Running the Shore Server, you saw several messages looking like this:

Warning: no database administrator -- running under userid 1417, groupid 1417
Looking for run command file "~/shore.rc" \ldots
format --./volumes/miniroot-- 20000 true
mkfs ./volumes/miniroot 20000 10
Done serving devices and making filesystems.

root = 0
setroot  10
/ is now 0.0.0.0:10.20007
See if  /  exists in the Shore namespace.
/  does exist
Done putting together the namespace.

Done reading ~/shore.rc.
Shore Server
Version ($Revision: 1.36 $ $Date: 1997/01/24 16:48:16 $)
(0)%

You can ignore most of these messages.

Warning: no database administrator ...
announces that the server is not being run by the super-user, or by the user shoreadm.
Looking for run command file "~/shore.rc" ...
If the server is configured to run a TCL shell (which it was), and if it is given a file to read when the shell starts (shore.rc in this case), it reads that file and interprets the commands therein. Among the commands in shore.rc were commands to format the device and volume for the root directory, mount the root directory, and print the full object identifier of the root directory.
format -./volumes/miniroot ...
mkfs ./volumes/miniroot ...
The script checks whether the "device" ./volumes/miniroot exists. If not it assumes that the device is really a Unix file, which it creates and initializes to look like an empty file system by issuing the commands
format ./volumes/miniroot 20000 true
mkfs ./volumes/miniroot 20000 10
The number 20000 is the size of the file created, in kilobytes. If you want to use a raw device, you must change both the configuration option svas_root in the configuration file .shoreconfig and the variable rootvolumename in the startup file shore.rc. Also the check to see whether the device exists will always succeed, so you will have to run the format and mkfs commands "by hand" the first time to format the device. The second and subsequent times you run SVAS, these lines of output will be replaced by
serve ./volumes/miniroot
meaning that the server has added this volume to the list of volumes for which it will act as a server.

Shore Server ...
After reading the file of TCL commands, the server's TCL shell prints a welcome message and a prompt for TCL commands.

The SVAS is now running a TCL shell in the window in which you started the server. As you run clients, you can also run TCL shell commands to the SVAS. Unfortunately, this shell has no user guide, but is has some on-line help. Type "commands" or "help".

 

Shutting the Server Down

The server shuts down when you type the command bye, which is synonymous with quit, q, exit, and x. You can also run the program sshutdown directly from a Unix shell window. This program contacts the server and causes it to shut down. (This is the only way of cleanly shutting down the server if you ran it without a TCL shell).

 

Changing Your Environment

If you want to change the location of your logs or the location of your data volumes, you will need to edit shore.rc (or whatever file you have chosen as your file of TCL commands). Warning: If your volumes or log are on a network file system (such as NFS or AFS) rather than a local disk, the server will be sluggish, and you must take care that the volumes and logs have the necessary permissions so that the user who runs the server can create and update the volumes and log files.

The file of TCL commands does several things:

1.
It defines a table of volumes on which to create file systems
2.
It formats the volumes if necessary. Warning: If your volumes are on a Unix raw device, you must do this step by hand.
3.
It determines if the root directory was already mounted when the configuration file was processed, and if not,
4.
It creates a file system (with the release, this corresponds to a volume) for the root of the Shore name space ("/") , and mounts it,
5.
It mounts any non-root volumes
6.
It creates some directories and pools used by the example applications, if they don't already exist.

If you want to change the location or size of your file system, look at the volume table at the beginning of the file. The comments there should be self-explanatory.


next up previous contents
Next: NFS-Mounting Your File System Up: Configuring and Running the Server Previous: Configuring a Shore Server
This page was generated from LaTeX sources
10/27/1997