author | viric@mandarina |
Fri, 02 Oct 2009 19:20:41 +0200 | |
changeset 274 | 62048132f95f |
parent 269 | 56061026d168 |
child 278 | 1698b327528d |
permissions | -rw-r--r-- |
57 | 1 |
System wide queue |
2 |
------------------------- |
|
79 | 3 |
You can set the $TS_SOCKET variable to the same name path for all your |
4 |
'ts' processes, and then |
|
57 | 5 |
they'll use the same socket for intercommunication. This means - single queue. |
6 |
You should be certain that any 'ts' can read/write to that socket, using |
|
79 | 7 |
chmod. |
8 |
||
9 |
||
10 |
A queue for each resource |
|
11 |
------------------------- |
|
12 |
You can use $TS_SOCKET and aliases/scripts for having different queues for |
|
13 |
different resources. For instance, using bash: |
|
14 |
alias tsdisk='TS_SOCKET=/tmp/socket.disk ts' |
|
15 |
alias tsram='TS_SOCKET=/tmp/socket.ram ts' |
|
16 |
alias tsnet='TS_SOCKET=/tmp/socket.net ts' |
|
57 | 17 |
|
165
7b914d4003c2
Fixing licenses in some files, and updating some documents.
viric@mandarina
parents:
79
diff
changeset
|
18 |
You can also create shell scripts like this: |
7b914d4003c2
Fixing licenses in some files, and updating some documents.
viric@mandarina
parents:
79
diff
changeset
|
19 |
<< FILE ts2 |
7b914d4003c2
Fixing licenses in some files, and updating some documents.
viric@mandarina
parents:
79
diff
changeset
|
20 |
#!/bin/sh |
7b914d4003c2
Fixing licenses in some files, and updating some documents.
viric@mandarina
parents:
79
diff
changeset
|
21 |
export TS_SOCKET=/tmp/socket-ts2.$USER |
7b914d4003c2
Fixing licenses in some files, and updating some documents.
viric@mandarina
parents:
79
diff
changeset
|
22 |
ts "$@" |
7b914d4003c2
Fixing licenses in some files, and updating some documents.
viric@mandarina
parents:
79
diff
changeset
|
23 |
>> END OF FILE ts2 |
7b914d4003c2
Fixing licenses in some files, and updating some documents.
viric@mandarina
parents:
79
diff
changeset
|
24 |
|
57 | 25 |
|
26 |
Be notified of a task finished |
|
27 |
------------------------- |
|
28 |
In X windows, inside bash, after submitting the task, I use: |
|
29 |
$ ( ts -w ; xmessage Finished! ) & |
|
165
7b914d4003c2
Fixing licenses in some files, and updating some documents.
viric@mandarina
parents:
79
diff
changeset
|
30 |
|
7b914d4003c2
Fixing licenses in some files, and updating some documents.
viric@mandarina
parents:
79
diff
changeset
|
31 |
|
183
95d49e8a8cec
Updating 'help' and some other related files to 0.5
viric@llimona
parents:
165
diff
changeset
|
32 |
Killing process groups |
95d49e8a8cec
Updating 'help' and some other related files to 0.5
viric@llimona
parents:
165
diff
changeset
|
33 |
------------------------- |
95d49e8a8cec
Updating 'help' and some other related files to 0.5
viric@llimona
parents:
165
diff
changeset
|
34 |
ts creates a new session for the job, so the pid of the command run can be |
95d49e8a8cec
Updating 'help' and some other related files to 0.5
viric@llimona
parents:
165
diff
changeset
|
35 |
used as the process group id for the command and its childs. So, you can use |
95d49e8a8cec
Updating 'help' and some other related files to 0.5
viric@llimona
parents:
165
diff
changeset
|
36 |
something like: |
95d49e8a8cec
Updating 'help' and some other related files to 0.5
viric@llimona
parents:
165
diff
changeset
|
37 |
$ kill -- -`ts -p` |
95d49e8a8cec
Updating 'help' and some other related files to 0.5
viric@llimona
parents:
165
diff
changeset
|
38 |
in order to kill the job started and all its childs. I find it useful when |
95d49e8a8cec
Updating 'help' and some other related files to 0.5
viric@llimona
parents:
165
diff
changeset
|
39 |
killing 'make's. |