os.dup2(so.fileno(), sys.stdout.fileno()) os.dup2(se.fileno(), sys.stderr.fileno()) if __name__ == '__main__': topics = conf.get_topic_name().split(",") index = 0 tail = [] stop_flag = False if sys.platform != 'win32': daemonize() single = SingleInstance() if conf.get_test_path() == "null": use( passport(conf.get_passport().split(":")[0], conf.get_passport().split(":")[1])) set_router(conf.get_routers()) for topic in topics: t = Tail(index, conf) tail.append(t) index += 1 logger.error("Tail file for topic: " + topic) def stop(n=0, e=0): global stop_flag logger.error("stopping.....") for t in tail:
os.dup2(si.fileno(), sys.stdin.fileno()) os.dup2(so.fileno(), sys.stdout.fileno()) os.dup2(se.fileno(), sys.stderr.fileno()) if __name__ == '__main__': topics = conf.get_topic_name().split(",") index = 0 tail = [] stop_flag = False if sys.platform != 'win32': daemonize() single=SingleInstance() if conf.get_test_path() == "null": use(passport(conf.get_passport().split(":")[0], conf.get_passport().split(":")[1])) set_router(conf.get_routers()) for topic in topics: t = Tail(index, conf) tail.append(t) index += 1 logger.error("Tail file for topic: " + topic) def stop(n=0, e=0): global stop_flag logger.error("stopping.....") for t in tail: logger.error("stopping " + str(t)) try: