args = sys.argv[1:] mode = "REMOTE" s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) if "-l" in args: s.bind(('127.0.0.1', 48903)) import run_local run_local.run() elif "-r" in args: s.bind(('172.16.25.227', 48903)) import run_remote run_remote.run() # s.bind(('10.104.152.191', 6652)) s.listen(5) print('Waiting for connection....') clients = dict() class PowerState: state = False pwrState = PowerState() def process_message(sock, message):
#!/usr/local/bin/python import sys from run_remote import run from constants import PROCS fn = sys.argv[1] command_str = " ".join(sys.argv[2:]) run(fn, command_str)
#!/usr/local/bin/python import sys from run_remote import run run(sys.argv[1], 'killall nolimit.bash; killall dissent')
#!/usr/local/bin/python import sys from constants import PROCS from run_remote import run, run_lambda run(sys.argv[1], 'killall -9 tor'); def command_str(my_index, my_proc, ctrl_host, leader_ip, leader_port, my_ip, my_port, is_server): return "cd /proj/Tng/exp/tor/datadirs/data%(my_index)d && rm lock" % {'my_index': my_index} print command return command run_lambda(sys.argv[1], command_str, sleep=0, procs=PROCS)