def create_control_socket(self): assert self.socket_dir dotxpra = DotXpra(self.socket_dir) sockpath = dotxpra.socket_path(":proxy-%s" % os.getpid()) state = dotxpra.get_server_state(sockpath) if state in (DotXpra.LIVE, DotXpra.UNKNOWN): log.warn( "You already have a proxy server running at %s, the control socket will not be created!", sockpath) return False try: sock = create_unix_domain_socket(sockpath, None, 0o600) sock.listen(5) except Exception as e: log("create_unix_domain_socket failed for '%s'", sockpath, exc_info=True) log.error("Error: failed to setup control socket '%s':", sockpath) log.error(" %s", e) return False self.control_socket = sock self.control_socket_path = sockpath log.info("proxy instance now also available using unix domain socket:") log.info(" %s", self.control_socket_path) return True
def create_control_socket(self): dotxpra = DotXpra(self.socket_dir) name = "proxy-%s" % os.getpid() sockpath = dotxpra.norm_make_path(name, dotxpra.sockdir()) state = dotxpra.get_server_state(sockpath) if state in (DotXpra.LIVE, DotXpra.UNKNOWN): log.warn("You already have a proxy server running at %s, the control socket will not be created!", sockpath) return False try: sock = create_unix_domain_socket(sockpath, None) sock.listen(5) except Exception, e: log.warn("failed to setup control socket %s: %s", sockpath, e) return False
def create_control_socket(self): dotxpra = DotXpra(self.socket_dir) name = "proxy-%s" % os.getpid() sockpath = dotxpra.norm_make_path(name, dotxpra.sockdir()) state = dotxpra.get_server_state(sockpath) if state in (DotXpra.LIVE, DotXpra.UNKNOWN): log.warn( "You already have a proxy server running at %s, the control socket will not be created!", sockpath) return False try: sock = create_unix_domain_socket(sockpath, None) sock.listen(5) except Exception, e: log.warn("failed to setup control socket %s: %s", sockpath, e) return False
def create_control_socket(self): dotxpra = DotXpra(self.socket_dir) name = "proxy-%s" % os.getpid() sockpath = dotxpra.norm_make_path(name, dotxpra.sockdir()) state = dotxpra.get_server_state(sockpath) if state in (DotXpra.LIVE, DotXpra.UNKNOWN): log.warn("You already have a proxy server running at %s, the control socket will not be created!", sockpath) return False try: sock = create_unix_domain_socket(sockpath, None, 0o600) sock.listen(5) except: log.warn("failed to setup control socket %s", sockpath, exc_info=True) return False self.control_socket = sock self.control_socket_path = sockpath log.info("proxy instance now also available using unix domain socket: %s", self.control_socket_path) return True
def create_control_socket(self): assert self.socket_dir dotxpra = DotXpra(self.socket_dir) sockpath = dotxpra.socket_path(":proxy-%s" % os.getpid()) state = dotxpra.get_server_state(sockpath) if state in (DotXpra.LIVE, DotXpra.UNKNOWN): log.warn("You already have a proxy server running at %s, the control socket will not be created!", sockpath) return False try: sock = create_unix_domain_socket(sockpath, None, 0o600) sock.listen(5) except Exception as e: log("create_unix_domain_socket failed for '%s'", sockpath, exc_info=True) log.error("Error: failed to setup control socket '%s':", sockpath) log.error(" %s", e) return False self.control_socket = sock self.control_socket_path = sockpath log.info("proxy instance now also available using unix domain socket:") log.info(" %s", self.control_socket_path) return True
def create_control_socket(self): dotxpra = DotXpra(self.socket_dir) name = "proxy-%s" % os.getpid() sockpath = dotxpra.norm_make_path(name, dotxpra.sockdir()) state = dotxpra.get_server_state(sockpath) if state in (DotXpra.LIVE, DotXpra.UNKNOWN): log.warn( "You already have a proxy server running at %s, the control socket will not be created!", sockpath) return False try: sock = create_unix_domain_socket(sockpath, None, 0o600) sock.listen(5) except: log.warn("failed to setup control socket %s", sockpath, exc_info=True) return False self.control_socket = sock self.control_socket_path = sockpath log.info( "proxy instance now also available using unix domain socket: %s", self.control_socket_path) return True