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.
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.
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.
format ./volumes/miniroot 20000 true mkfs ./volumes/miniroot 20000 10The 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/minirootmeaning that the server has added this volume to the list of volumes for which it will act as a server.
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".
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).
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:
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.