コード例 #1
0
    def _refresh_dnsmasq(self):
        dnsmasq_pid = linux.get_pid_by_process_name('dnsmasq')
        if not dnsmasq_pid:
            logger.debug('dnsmasq is not running, try to start it ...')
            output = self._do_dnsmasq_start()
            dnsmasq_pid = linux.get_pid_by_process_name('dnsmasq')
            if not dnsmasq_pid:
                raise virtualrouter.VirtualRouterError('dnsmasq in virtual router is not running, we try to start it but fail, error is %s' % output)

        shell.call('kill -1 %s' % dnsmasq_pid)
コード例 #2
0
ファイル: dnsmasq.py プロジェクト: QiRaining/zstack-utility
    def _refresh_dnsmasq(self):
        dnsmasq_pid = linux.get_pid_by_process_name('dnsmasq')
        if not dnsmasq_pid:
            logger.debug('dnsmasq is not running, try to start it ...')
            output = self._do_dnsmasq_start()
            dnsmasq_pid = linux.get_pid_by_process_name('dnsmasq')
            if not dnsmasq_pid:
                raise virtualrouter.VirtualRouterError('dnsmasq in virtual router is not running, we try to start it but fail, error is %s' % output)

        if self.signal_count > self.config.init_command.restartDnsmasqAfterNumberOfSIGUSER1:
            self._restart_dnsmasq()
            self.signal_count = 0
            return

        shell.call('kill -1 %s' % dnsmasq_pid)
        self.signal_count += 1
コード例 #3
0
ファイル: dnsmasq.py プロジェクト: ilibx/zstack-utility
    def _refresh_dnsmasq(self):
        dnsmasq_pid = linux.get_pid_by_process_name('dnsmasq')
        if not dnsmasq_pid:
            logger.debug('dnsmasq is not running, try to start it ...')
            output = self._do_dnsmasq_start()
            dnsmasq_pid = linux.get_pid_by_process_name('dnsmasq')
            if not dnsmasq_pid:
                raise virtualrouter.VirtualRouterError('dnsmasq in virtual router is not running, we try to start it but fail, error is %s' % output)

        if self.signal_count > self.config.init_command.restartDnsmasqAfterNumberOfSIGUSER1:
            self._restart_dnsmasq()
            self.signal_count = 0
            return

        shell.call('kill -1 %s' % dnsmasq_pid)
        self.signal_count += 1
コード例 #4
0
ファイル: dnsmasq.py プロジェクト: QiRaining/zstack-utility
 def check_start(_):
     dnsmasq_pid = linux.get_pid_by_process_name('dnsmasq')
     return dnsmasq_pid is not None 
コード例 #5
0
ファイル: dnsmasq.py プロジェクト: ilibx/zstack-utility
 def check_start(_):
     dnsmasq_pid = linux.get_pid_by_process_name('dnsmasq')
     return dnsmasq_pid is not None