TERDS

A Tool for the Easy Realization of Distributed Systems

TERDS is a primitive tool for building distributed systems. The tasks of a TERDS system communicate with and control each other by writing specially formatted commands to their standard output. Tasks receive data from other tasks by reading the data from their standard input. Tasks are identified by integer task IDs, which are used in some commands to identify the target task. The tasks are supervised by a monitor which intercepts all standard output from all tasks, implements control commands, passes on data from communication commands, and provides simple standard input and output facilities for tasks. The user may interact with a distributed system as a priviledged task with task ID 0, by issueing commands from the keyboard and receiving responses on the screen. Tasks may run on any machine on which the user has rsh priviledges (granted in the .rhosts file).

The TERDS software has two components:

TERDS requires perl version 5. To start TERDS, execute the TERDS script.

TERDS Commands

Tasks issue TERDS commands by sending them to their standard output, preceded by :::. The monitor understands that any line of standard output starting with ::: is a TERDS command, and will implement the command. The commands are echoed to the user screen (unless supressed as explained below). Lines of output that start with anything other than ::: are considered by the monitor to be normal standard output, and are echoed to the user screen (unless supressed as explained below).
list option
Sends a list of task information to the stnadard intput of the task that output the command. The options are: For each task one (long) line is output, being the concatenation of: After the lines for the tasks, a terminating line :::EOF::: is output.
create machine program
Starts a new task on the machine running the program. Depending on local name resolution, the machine may be a simple machine name or may need to be a fully qualified machine name. The program is anything that can be run on the machine, and may include program arguments.
send task ID data
Sends the data to the standard input of the task with the task ID. If the task ID is all then the data is send to the standard input of all tasks (including the priviledged user task 0).
suspend task ID
Suspends the execution of the running task with the task ID. The priviledged user task 0 cannot be suspended. If the task ID is all then all tasks (except the priviledged user task 0) are suspended.
activate task ID
Activates the execution of the suspended task with the task ID. The priviledged user task 0 cannot be activated. If the task ID is all then all tasks (except the priviledged user task 0) are activated.
kill task ID
Kills the execution of the task with the task ID. The priviledged user task 0 cannot be killed. If the task ID is all then all tasks (except the priviledged user task 0) are killed.
trace task ID
Turns on the echo of commands output by the task with the task ID, to the user screen. If the task ID is all then all tasks' commands are echoed. When a task is createed, the echo of commands is initially on.
notrace task ID
Turns off the echo of commands output by the task with the task ID, to the user screen. If the task ID is all then no tasks' commands are echoed.
listen task ID
Turns on the echo of standard output from the task with the task ID, to the user screen. If the task ID is all then all tasks' standard output is echoed. When a task is createed, the echo of standard output is initially on.
nolisten task ID
Turns off the echo of standard output from the task with the task ID, to the user screen. If the task ID is all then no tasks' standard output is echoed.
log task ID file name
Turns on the logging of commands and standard output from the task with the task ID, to the file named file name.
nolog task ID
Turns off the logging of commands and standard output from the task with the task ID, to the file named file name. When a task is createed, the logging of commands and standard output is initially off.
^D
Terminates TERDS. Only the priviledged user task 0 can terminate TERDS.

Example Programs

Sample Runs

Input from the user is emphsized.