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)
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
def check_start(_): dnsmasq_pid = linux.get_pid_by_process_name('dnsmasq') return dnsmasq_pid is not None