-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathheartbeat
More file actions
executable file
·44 lines (38 loc) · 854 Bytes
/
heartbeat
File metadata and controls
executable file
·44 lines (38 loc) · 854 Bytes
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
#!/usr/bin/python
import cluster
from cluster import *
import sys
import logging
def main():
level = logging.INFO
if '-d' in sys.argv:
level = logging.DEBUG
sys.argv.remove('-d')
logging.getLogger().setLevel(level)
up = 1
server = 0
clients = 0
if '-k' in sys.argv:
up = 0
sys.argv.remove('-k')
if '-s' in sys.argv:
server = 1
sys.argv.remove('-s')
if '-c' in sys.argv:
clients = 1
sys.argv.remove('-c')
hosts = cluster.HOSTS
if len(sys.argv) > 1:
hosts = sys.argv[1:]
if up:
if server:
startZeoServer()
if clients:
startZeoClients(hosts)
else:
if clients:
stopZeoClients(hosts)
if server:
stopZeoServer()
if __name__ == '__main__':
main()