def main(snoopyDir):

	global goFlag
	while ( goFlag ):

		logging.basicConfig(filename="%s/logs/snoopy.log"%(snoopyDir),level=logging.INFO,format='%(asctime)s %(levelname)s %(filename)s: %(message)s',datefmt='%Y-%m-%d %H:%M:%S')
		logging.info("\n--------------------------------------------------------------")
		logging.info("Main Snoopy Process starting. Divert all power to the engines!")
		pool=[]
		pool.append( Process(target=prox_guid.main) )
		pool.append( Process(target=facebook.main, args=('%s'%(snoopyDir),)) )
		pool.append( Process(target=pytail.main, args=('%s/uploads/'%(snoopyDir),)) )	
		pool.append(Process(target=ssid_to_loc.main) )
		pool.append(Process(target=webmain.start))
	
		for p in pool:
			p.start()
	
		all_good=True
		while all_good and goFlag:
			for p in pool:
				if not p.is_alive():
					all_good = False
			time.sleep(2)
	
		for p in pool:
			p.terminate()
	
		if(  goFlag ):
			logging.warning("One of my processes died, I'll restart all")
			main(snoopyDir)
	
	logging.debug("Process ended")
dataset/ETHPy150Open sensepost/Snoopy/snoopy/server/bin/snoopy_server.py/main/original