0
|
1 |
Tool objectives
|
|
2 |
---------------------------
|
|
3 |
- Be able to send commands to the computer, so that they run one after another,
|
|
4 |
stored in a queue.
|
|
5 |
- Control what to do with the input/output of those programs
|
|
6 |
|
|
7 |
Limits
|
|
8 |
---------------------------
|
|
9 |
- One queue system per user per system
|
|
10 |
|
|
11 |
Interface
|
|
12 |
---------------------------
|
|
13 |
The user should see a single command: ts
|
|
14 |
The default action (maybe on "ts - ...") should be appending a job to the
|
|
15 |
default queue.
|
|
16 |
|
|
17 |
Job execution
|
|
18 |
---------------------------
|
|
19 |
The jobs should receive the proper environment from the shell/parent they were
|
|
20 |
queued on.
|
|
21 |
The errorlevels, and maybe some statistical information (times, bytes in/out)
|
|
22 |
should be stored in the queue. The user should be able to check the result of
|
|
23 |
the jobs at any time.
|
|
24 |
We should fork a '$SHELL' and run the job command, because a user may expect his
|
|
25 |
shell parser.
|
|
26 |
|
|
27 |
Queues
|
|
28 |
---------------------------
|
|
29 |
There should be different queues, each with an id. The command will work by
|
|
30 |
default with one quue.
|
|
31 |
Each queue will have jobs in different states:
|
|
32 |
- running
|
|
33 |
- queued
|
|
34 |
- blocked (wrong errorlevel on the previous job? optional)
|
|
35 |
- finished (the user can see the errorlevel,etc.)
|
|
36 |
|
|
37 |
Input/output
|
|
38 |
---------------------------
|
|
39 |
The user, when adding a job to the queue, should be able to choose:
|
|
40 |
- Where the output goes. As flags:
|
|
41 |
- store: put it into a file in /tmp (or similar).
|
|
42 |
- mail: put it into a file in /tmp, and send it by mail (maybe gzipped)
|
|
43 |
- gzip: directly gzip the output
|
|
44 |
- tail: store in a buffer the last 10 lines
|
|
45 |
A user may choose "mail || gzip", and the file should be mailed gzipped. Or
|
|
46 |
"gzip || tail", and the file should be stored directly gzipped, although with
|
|
47 |
tailing available.
|
|
48 |
- What to do with the input: opened/closed
|
|
49 |
If opened, the user should be able to connect its current stdin to the
|
|
50 |
process'.
|
|
51 |
|
|
52 |
Job management
|
|
53 |
---------------------------
|
|
54 |
- Shutdown: stop all the background processes related to the queues.
|
|
55 |
- tail (id): 'tail' the last lines of a process' output.
|
|
56 |
- list: list the queues, with relevant information
|
|
57 |
- wait (id)*: block until some processes dies
|
|
58 |
- remove (id)+: remove jobs from the queue
|
|
59 |
- clear: remove the information about dead jobs (errorlevels, etc.)
|
|
60 |
|
|
61 |
|
|
62 |
----------------------------------
|
|
63 |
Implementation
|
|
64 |
------------------------------------
|
|
65 |
|
|
66 |
Client/Server
|
|
67 |
----------------------
|
|
68 |
A central server daemon will have the main list of jobs, will open a socket,
|
|
69 |
and all the clients will tell what to do through it.
|
|
70 |
This daemon will be started , if a client cannot find it.
|
|
71 |
The client will go immediatly to background when the user adds a new job.
|
|
72 |
A minimum version control should be done between client/server, to assure the
|
|
73 |
dialog will be correct.
|
|
74 |
|
|
75 |
Connections
|
|
76 |
-----------------------
|
|
77 |
The connections could go through a Unix socket in /tmp, as X windows.
|
|
78 |
An env variable could have a preference for a socket other than the default.
|
|
79 |
Let's say, /tmp/ts-$USER-0.socket
|
|
80 |
|
|
81 |
Protocol
|
|
82 |
-----------------------
|
|
83 |
The clients should pass messages to the server, and vicerveza.
|
|
84 |
Some messages should allow:
|
|
85 |
- new job
|
|
86 |
- list jobs
|
|
87 |
- input data
|
|
88 |
- tail data
|
|
89 |
- get job info
|
|
90 |
- wait job
|