| #!/usr/bin/python |
| |
| import os, os.path, sys |
| |
| dir = os.path.abspath(os.path.dirname(sys.argv[0])) |
| monitor_queue = os.path.join(dir, 'monitor_queue') |
| |
| if len(sys.argv) < 2: |
| print "Usage: start_all_queues <top_level_dir>" |
| sys.exit(1) |
| |
| top_dir = os.path.abspath(sys.argv[1]) |
| queue_dir = os.path.join(top_dir, 'queue') |
| results_dir = os.path.join(top_dir, 'results') |
| |
| for machine in os.listdir(queue_dir): |
| queue = os.path.join(queue_dir, machine) |
| results = os.path.join(results_dir, machine) |
| |
| if not os.path.exists(results): |
| print "No results directory: %s" % results |
| sys.exit(1) |
| |
| console_path = "/usr/local/conmux/etc/%s.cf" % machine |
| if os.path.exists(console_path): |
| console = machine |
| else: |
| console = '' |
| |
| cmd = ' '.join([monitor_queue, machine, queue, results, console]) |
| print cmd |
| os.system("nohup %s > %s/.log 2>&1 &" % (cmd,queue)) |
| |