NAME

telco - observatory master controller

SYNOPSIS

telco [debug] [[reqid=] | [daemon] ]

DESCRIPTION

telco is the central program in the operation of the observatory. It is a constantly running daemon that loops creating the telescope schedule by invoking insgen and making the observations by executing the Procedures. telco is usually started using the startnet script. Furthermore that the programs and procedures are in the directory ~$(TELESCOPE)/bin.
WAITING STRATEGY
In daemon mode the program does the following: When not in daemon mode it:
REQUEST EXECUTION
When telco executes a request it looks up the list of targets and their associated Procedures from the database. Remember a request may have multiple targets. For each target it then executes the command:
/home/telescope/bin/procname tarid=TargetID logid=LogID
Where telescope is the telescope set by the TELESCOPE environment variable, and procname is the Procedure Name which may have additional arguments, TargetID is the ID number of the targets and LogID is the ID of the logging record. The hard coding of the pathname is a simple security mechanism.

If all the targets are observed sucessfully, telco executes the FinalProcedure similar to that above but without a target id. The FinalProcedure may be NULL.

After all the targets in the request have been observed sucessfully telco logs this happy event in the database by entering a notation in the Log table.

Success=1
It also increments the value of NumberDone in the Request table. If any of the targets fails, the observation is terminated immediately not finishing the remaining ones (or executing the FinalProcedure) and telco puts a notation in the Log table.
Success=0
PATHS AND PROGRAMS
telco assumes that the TELESCOPE environment variable is set which is the user of the controlling telescope.
TALKING TO TELCO
telco forks in order to accept commands over sockets (in this case port=0x1360) just like all the telescope device servers (e.g. rtel). However, I have not tied in this server with tserver (it could be), but have instead aliased to a new tin command. The command set is the following: Here is an example of stopping the telco to execute a particular request (ID=3190):
tin interrupt 
tin reqid=3190
tin resume

When running you may use the tin command to query the status. For example when used without arguments it returns a line similar to:

done telco daemon=1 status=napping reqid=356 wake=2008-02-21T06:01:26Z name=Q0906+6930
This example says that the daemon is active, that the next request is id=356, it is sleeping until the ISO time and will execute .

abort kills the procedure that is currently executing. It doesn't kill the commands within the procedure and so things may still be going on. It should only be used in emergencies.

The tin command reports back the status of telco. The allowed states are:

UPDATING DATABASE
If you have added a new request to the database and want telco to change its plans run the command:
tin resume 
This causes the sleep to be interrupted and and insgen import to be run again
DEALING WITH BAD WEATHER AND EQUIPMENT FAILURES
If the weather is bad, telco will try to observe the scheduled request but it will fail. If there are NFAIL=5 failures in a row, telco will execute the closedown procedure and sleep for one hour.

COMMAND LINE OPTIONS

reqid= executes the specified RequestID immediately and blocks until it is finished. The program exits with the exit code from the execution of the request. It is incompatible with the daemon mode.

daemon - turns on the daemon mode on startup; without it, the daemon is off.

debug- generates lot of printout in particular the queries to the database.

SEE ALSO

insgen Database startnet
Program index