forked from franciozzy/synexec
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
93 lines (70 loc) · 3.35 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
synexec
-------
Synchronised Executioner
Copyright 2014 (c) Citrix
Disclaimer:
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, version only.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Description:
Synchronised Executioner is a VERY INSECURE, UNAUTHENTICATED network-based
cooperative protocol developed to coordinate the execution of tasks, possibly
in a virtualised environment. A master process (ideally running on a control
domain) and one or more slave processes (ideally running within virtual
machines) will cooperate to:
- Establish a session amongst the master and the slaves;
- Negotiate what tasks are to be executed and transfer the necessary data;
- Execute the tasks, keeping track of progress and reporting periodically.
See NOTES for further information on the protocol.
WARNING:
Remember that this software will allow ANY MASTER (including any other
software, malicious or not, that understands the protocol) to run ANY CODE
on a reachable host running a synexec_slave.
Compiling:
Run "make" from the project root directory.
Usage:
To run a master process:
./synexec_master [ -hvd ] [ -i <if_name> ]
[ -p <port> ] [-s <session> ] <slaves> <conf>
-h Print a help message and quit.
-v Increase verbosity (may be used multiple times).
-d Run as daemon. stdout/stderr will be redirect to a log file.
-i <if_name> Use interface <if_name> instead of default.
-p <port> Override default network port (5165) with <port>.
-s <session> Define session ID to <session> (uint32_t, default 0).
<slaves> Wait for these many slaves before starting.
<conf> Configuration file for this session.
A configuration file is organised as follows:
First line:
* The command line to be executed by the slaves.
* The first parameter of this command line must be an executable file.
* First line example: /bin/sleep 5s
Remainder of the file:
* The remainder of the file will be copied to the slave.
* By default, a slave will store the file in /tmp/synexec_slave_conf.<pid>
* The configuration file can be passed in the command line by using the
special tag ":CONF:" (without quotes).
Full example:
/bin/bash :CONF:
#!/bin/bash
mkdir /src || exit
/bin/dd if=/dev/urandom of=/src/file.dat bs=1024 count=1048576
cp -a /src /dst
Explanation:
The above configuration file will result into a file being created into
each slave's /tmp/ and named synexec_slave_conf.1234 (where 1234 is the
corresponding PID for the synexec_slave process. The file contents will
be:
#!/bin/bash
mkdir /src || exit
/bin/dd if=/dev/urandom of=/src/file.dat bs=1024 count=1048576
The slave will then execute the following command:
/bin/bash /tmp/synexec_slave_conf.1234
All the output from the slave will be placed into the file synexec.out,
also in the /tmp/ directory.