示例#1
0
    def stop_process(self):
        terminated = utils.stop_process(self.process)

        if not terminated:
            logger.error('Failed to stop server process. %r' % {
                'server_id': self.server.id,
                'instance_id': self.instance_id,
            })
            return False

        return terminated
示例#2
0
    def stop_process(self):
        self.sock_interrupt = True
        terminated = utils.stop_process(self.process)

        if not terminated:
            logger.error('Failed to stop server process', 'server',
                server_id=self.server.id,
                instance_id=self.id,
            )
            return False

        return terminated
示例#3
0
 def stop_watch(self):
     try:
         while True:
             if self.stop_event.wait(1):
                 return
             yield
     finally:
         try:
             if not utils.stop_process(self.process):
                 logger.error('Failed to stop openvpn link process. %r' % {
                     'server_id': self.server.id,
                 })
         finally:
             if self.interface:
                 utils.tun_interface_release(self.interface)
                 self.interface = None
示例#4
0
    def stop_process(self):
        self.sock_interrupt = True

        for instance_link in self.server_links:
            instance_link.stop()

        terminated = utils.stop_process(self.process)

        if not terminated:
            logger.error('Failed to stop server process', 'server',
                server_id=self.server.id,
                instance_id=self.id,
            )
            return False

        return terminated
示例#5
0
 def stop_watch(self):
     try:
         while True:
             if self.stop_event.wait(1):
                 return
             yield
     finally:
         try:
             if not utils.stop_process(self.process):
                 logger.error('Failed to stop openvpn link process',
                     'server',
                     server_id=self.server.id,
                 )
         finally:
             if self.interface:
                 utils.tun_interface_release(self.interface)
                 self.interface = None
示例#6
0
 def stop_watch(self):
     try:
         while True:
             if self.stop_event.wait(1):
                 return
             yield
     finally:
         try:
             if not utils.stop_process(self.process):
                 logger.error('Failed to stop openvpn link process',
                     'server',
                     server_id=self.server.id,
                 )
         finally:
             if self.interface:
                 utils.interface_release(self.linked_server.adapter_type,
                     self.interface)
                 self.interface = None
示例#7
0
    def stop_process(self):
        self.sock_interrupt = True

        for instance_link in self.server_links:
            instance_link.stop()

        if self.process:
            terminated = utils.stop_process(self.process)
        else:
            terminated = True

        if not terminated:
            logger.error('Failed to stop server process', 'server',
                server_id=self.server.id,
                instance_id=self.id,
            )
            return False

        return terminated
示例#8
0
 def stop_watch(self):
     try:
         while True:
             if self.stop_event.wait(1):
                 return
             yield
     finally:
         try:
             if not utils.stop_process(self.process):
                 logger.error(
                     'Failed to stop openvpn link process',
                     'server',
                     server_id=self.server.id,
                 )
         finally:
             if self.interface:
                 utils.interface_release(
                     'tap' if self.linked_server.network_mode == BRIDGE else
                     'tun', self.interface)
                 self.interface = None
示例#9
0
 def stop_watch(self):
     try:
         while True:
             if self.stop_event.wait(1):
                 return
             yield
     finally:
         try:
             if not utils.stop_process(self.process):
                 logger.error('Failed to stop openvpn link process',
                     'server',
                     server_id=self.server.id,
                 )
         finally:
             if self.interface:
                 utils.interface_release(
                     'tap' if self.linked_server.network_mode == BRIDGE \
                         else 'tun',
                     self.interface)
                 self.interface = None