Ejemplo n.º 1
0
def start():
    if process_manager.check_process() == False:
         sys.exit(0)
    process_manager.record_pid(str(os.getpid()))

    m_thread = monitor_thread.monitor_thread()

    m_thread.start()

    m_thread.join()
Ejemplo n.º 2
0
def start_all():
    env_dirs = list_all_env_dirs()
    cwd = os.getcwd()
    processes = []
    if process_manager.check_process() == False:
        print "Stun service already exists !!!"
        sys.exit(0)
    # start process
    for env in env_dirs:
        print 'starting in ' + env + '\r\n'
        target_cwd = os.path.join( cwd , env )
        os.chdir( target_cwd )
        new_process = subprocess.Popen( [submitter_config.python_bin , os.path.join( cwd , "stun_submitter.py" )] ,
 shell=False )
        processes.append( new_process )
        os.chdir( cwd )
        process_manager.record_pid(str(new_process.pid))
    for p in processes:
      p.wait()
Ejemplo n.º 3
0
def start():
    if process_manager.check_process() == False:
         sys.exit(0)
    process_manager.record_pid(str(os.getpid()))
    u_thread = config_update_thread()
    u_thread.start()
    while u_thread.config_updated_ == False:
        if not u_thread.isAlive():
            print 'update config thread is dead!!!'
            sys.exit(-1)
        else:
            time.sleep(1)

    m_thread = monitor_thread.monitor_thread()
    s_thread = submitter_thread.submitter_thread()

    m_thread.start()
    s_thread.start()

    m_thread.join()
    s_thread.join()
    u_thread.join()