def start_action(): '''Start the event manager daemon.''' pid_file = opts.pid_file if os.path.isfile(pid_file): pid = get_pid(pid_file) if pid_running(pid): logger.error('event manager already started with pid %d', pid) return logger.info('no process with pid %d', pid) del_pid_file(pid_file) listener = Listener(opts.server_socket) listener.start() plugind = PluginDirectory() daemon = UzblEventDaemon(listener, plugind) daemon.run()
def listen(self): '''Start listening on socket''' self.listener = Listener(self.server_socket) self.listener.target = self self.listener.start()