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:
perl
script that implements the monitor functionality, and provides the
user task interface.
This script starts the TERDS system.
perl
script required for starting new tasks.
This script must be available on each machine that will run any tasks,
typically made available through NFS.
perl
version 5.
To start TERDS, execute the TERDS
script.
:::
. 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
all
: Lists all tasks. This is the default if the
option is omitted.
self
: Lists only the task that output the command.
parent
: Lists only the parent of the task that
output the command.
children
: Lists only the children of the task
that output the command.
:::TaskID=
task ID
:::ParentTaskID=
parent's task ID
:::HostName=
host machine name
:::PID=
UNIX PID of the task
:::Program=
command line of the program
being executed by the task
:::StartedAt=
time and date the task
was started
:::RunStatus=
task status, one of
running
or suspended
:::TraceStatus=
a flag, 0
or 1
, indicating whether or not
commands output by the task are echoed to the user screen
:::ListenStatus=
a flag, 0
or 1
, indicating whether or not
normal standard output from the task is echoed to the user
screen
:::LogStatus=
a flag, 0
or 1
, indicating whether or not
commands and standard output from the task are being logged
to a file
:::LogFileName=
if commands and standard
output are being logged to a file, the name of the file
:::
:::EOF:::
is output.
create
machine program
send
task ID data
all
then the data
is send to the standard input of all tasks (including the
priviledged user task 0
).
suspend
task ID
0
cannot be suspended.
If the task ID is all
then all tasks (except
the priviledged user task 0
) are suspended.
activate
task ID
0
cannot be activated.
If the task ID is all
then all tasks (except
the priviledged user task 0
) are activated.
kill
task ID
0
cannot be killed.
If the task ID is all
then all tasks (except
the priviledged user task 0
) are killed.
trace
task ID
all
then all tasks' commands
are echoed.
When a task is create
ed, the echo of commands is
initially on.
notrace
task ID
all
then no tasks' commands
are echoed.
listen
task ID
all
then all tasks'
standard output is echoed.
When a task is create
ed, the echo of standard output
is initially on.
nolisten
task ID
all
then no tasks'
standard output is echoed.
log
task ID file name
nolog
task ID
create
ed, the logging of commands
and standard output is initially off.
^D
0
can terminate TERDS.
EchoTask
:
Echos to standard output anything sent to its standard input,
until stop
is sent.
FindParentTask
:
Gets and outputs the task information for its parent.
SleepyTask
:
Takes a single integer argument, and writes three lines of standard
output every argument seconds.
SuicideTask
:
Sleeps for 3 seconds, then outputs a kill all
command
and waits to die.
PingTask
and
PongTask
:
The PingTask
outputs a command to create the
PongTask
, uses list commands to get its own and the
PongTask
's task IDs, then repeated sends ping
and its own task ID to the PongTask
.
The PongTask
receives the ping
and task ID,
and sends a pong
back to the PingTask
.
After 10 ping
s, the PongTask
sends
pong end
back, which stops the PingTask
.
EchoTask
geoff@gettysburg:TERDS> TERDS :::create gettysburg /home/escambia/geoff/perl/TERDS/EchoTask ALERT: Task 1 has started :::list :::TaskID=0:::ParentTaskID=-1:::HostName=gettysburg:::PID=17729:::Program=user:: :StartedAt=Thu Apr 6 11:05:17 EDT 2000:::RunStatus=running:::TraceStatus=0:::Li stenStatus=1:::LogStatus=0:::LogFileName=none::: :::TaskID=1:::ParentTaskID=0:::HostName=gettysburg:::PID=17741:::Program=/home/e scambia/geoff/perl/TERDS/EchoTask:::StartedAt=Thu Apr 6 11:05:20 EDT 2000:::Run Status=running:::TraceStatus=1:::ListenStatus=1:::LogStatus=0:::LogFileName=none ::: :::EOF::: :::send 1 To the EchoTask <- 1: To the EchoTask -> 1: 17741 received =To the EchoTask= :::kill 1 -> 1: Killed ALERT: Task 1 has ended ^D ALERT: Task 0 has ended geoff@gettysburg:TERDS>
PingTask
and
PongTask
geoff@gettysburg:TERDS> TERDS :::create gettysburg /home/escambia/geoff/perl/TERDS/PingTask ALERT: Task 2 has started -> 2: Ping about to get its own TaskID -> 2: :::list self <- 2: :::<- 2: TaskID=2:::<- 2: ParentTaskID=0:::<- 2: HostName=gettysbu rg:::<- 2: PID=17791:::<- 2: Program=/home/escambia/geoff/perl/TERDS/PingTas k:::<- 2: StartedAt=Thu Apr 6 11:10:41 EDT 2000:::<- 2: RunStatus=running:: :<- 2: TraceStatus=1:::<- 2: ListenStatus=1:::<- 2: LogStatus=0:::<- 2: LogFileName=none:::<- 2: <- 2: :::EOF::: -> 2: Ping self line is :::TaskID=2:::ParentTaskID=0:::HostName=gettysburg:::P ID=17791:::Program=/home/escambia/geoff/perl/TERDS/PingTask:::StartedAt=Thu Apr 6 11:10:41 EDT 2000:::RunStatus=running:::TraceStatus=1:::ListenStatus=1:::LogS tatus=0:::LogFileName=none::: -> 2: -> 2: Ping TaskID is 2 -> 2: Ping about to start pong -> 2: :::create gettysburg.cs.miami.edu /home/escambia/geoff/perl/TERDS/PongTa sk ALERT: Task 3 has started -> 2: Ping gets pong information -> 2: :::list children <- 2: :::<- 2: TaskID=3:::<- 2: ParentTaskID=2:::<- 2: HostName=gettysbu rg.cs.miami.edu:::<- 2: PID=17801:::<- 2: Program=/home/escambia/geoff/perl/ TERDS/PongTask:::<- 2: StartedAt=Thu Apr 6 11:10:47 EDT 2000:::<- 2: RunSta tus=running:::<- 2: TraceStatus=1:::<- 2: ListenStatus=1:::<- 2: LogStatus =0:::<- 2: LogFileName=none:::<- 2: <- 2: :::EOF::: -> 2: Ping children is :::TaskID=3:::ParentTaskID=2:::HostName=gettysburg.cs.m iami.edu:::PID=17801:::Program=/home/escambia/geoff/perl/TERDS/PongTask:::Starte dAt=Thu Apr 6 11:10:47 EDT 2000:::RunStatus=running:::TraceStatus=1:::ListenSta tus=1:::LogStatus=0:::LogFileName=none::: -> 2: -> 2: Pong task is is 3 -> 2: Ping is sending a pong in 1 second -> 3: Pong is waiting for a ping -> 2: :::send 3 ping 2 <- 3: ping 2 -> 3: Pong got a ping line =ping 2= -> 2: Ping is waiting for a pong -> 3: Pong will reply to 2 in 1 second -> 3: :::send 2 pong <- 2: pong -> 2: Ping got a pong <some output omitted> -> 2: Ping is sending a pong in 1 second -> 3: Pong is waiting for a ping -> 2: :::send 3 ping 2 <- 3: ping 2 -> 3: Pong got a ping line =ping 2= -> 2: Ping is waiting for a pong -> 3: Pong will reply to 2 in 1 second -> 3: :::send 2 pong end <- 2: pong end ALERT: Task 3 has ended -> 2: Ping got a pong ALERT: Task 2 has ended ^D ALERT: Task 0 has ended geoff@gettysburg:TERDS>