importosimportsysimporttimedefrunApache(args):sleep=60conf=args[0]whileTrue:ready=Trueforfinconf.get('required_path_list',[]):ifnotos.path.exists(f):print'File %r does not exists, sleeping for %s'%(f,sleep)ready=Falseifready:breaktime.sleep(sleep)apache_wrapper_list=[conf['binary'],'-f',conf['config'],'-DFOREGROUND']apache_wrapper_list.extend(sys.argv[1:])sys.stdout.flush()sys.stderr.flush()os.execl(apache_wrapper_list[0],*apache_wrapper_list)