restarts a service
778785
def restart_service(service):
    
    with settings(hide('running', 'stdout'), warn_only=True):
        log_yellow('stoping service %s' % service)
        sudo('service %s stop' % service)
        log_yellow('starting service %s' % service)
        sudo('service %s start' % service)
1203551
public void restartDyno(String appName, String dynoId) {
        connection.execute(new DynoRestart(appName, dynoId), apiKey);
    }
1331896
def restart(self, key):
        """"""
        if key in self.queue:
            if self.queue[key]['status'] in ['failed', 'done']:
                new_entry = {'command': self.queue[key]['command'],
                             'path': self.queue[key]['path']}
                self.add_new(new_entry)
                self.write()
                return True
        return False
1169088
def resume_all(self):
        """"""
        for alias, service in self._service_objects.items():
            with expects.expect_no_raises(
                    'Failed to pause service "%s".' % alias):
                service.resume()
1258169
def restart(self, wait=True, timeout=None, wait_polling_interval=None):
        
        self.stop(timeout=timeout)
        self.start(wait, timeout=timeout, wait_polling_interval=wait_polling_interval)
1264143
function restartNode() {
        try {
            _nodeConnection.domains.base.restartNode();
        } catch (e) {
            window.alert("Failed trying to restart Node: " + e.message);
        }
    }
1245789
def restart(self, password=''):
        
        with self.lock:
            self.send('RESTART :%s' % password, error_check=True)
314457
function restartProcessing (q) {
  logger('restartProcessing')
  setTimeout(function randomRestart () {
    queueProcess.restart(q)
  }, Math.floor(Math.random() * 1000))
}
1222915
def restart(self, timeout=None, task=None, block_callbacks=False, role=None):
        
        self.set_state('restarting')
        if not block_callbacks:
            self.__cb_pending = ACTION_ON_RESTART
        ret = self.stop(block_callbacks=True) and self.start(timeout, task, True, role)
        if not ret and not self.is_starting():
            self.set_state('restart failed ({0})'.format(self.state))
        return ret
1616
def startService(self):
        
        service.Service.startService(self)
        self._toState('idle')

        try:
            self.connect()
        except NoConsumerError:
            pass
90162
def restart
      conns = storage.get_all(teams_key)
      storage.pipeline do
        conns.each { |k, _| storage.set(teams_key, k, 'restart') }
      end
    end
32369
public void restart(Long id) {

        Watchdog wd = (Watchdog) this.registeredWachdogs.get(id);
        if (wd == null) {
            throw new IllegalStateException("Watchdog " + id + " ist not registered");
        }
        wd.restart();
    }
1111760
public void restart() {
        sync.lock();

        try {

            stop();
            Thread.sleep(1000); // allow some time to release native resources
            start();

        } catch (InterruptedException e) {
            // ignore
        } finally {
            sync.unlock();
        }
    }
503550
public function Restart() {
      $this->Permission('Garden.Import'); // This permission doesn't exist, so only users with Admin == '1' will succeed.

      // Delete the individual table files.
      $Imp = new ImportModel();
      try {
         $Imp->LoadState();
         $Imp->DeleteFiles();
      } catch(Exception $Ex) {
      }
      $Imp->DeleteState();

      Redirect(strtolower($this->Application).'/import');
   }
1275754
def restart(self):
        

        rc_new = copy.deepcopy(self)
        return K8sReplicationController.rolling_update(
            config=self.config,
            name=self.name,
            rc_new=rc_new)
73121
def service_network_restart():
    
    log = logging.getLogger(mod_logger + '.service_network_restart')
    command = ['service', 'network', 'restart']
    time.sleep(5)
    try:
        result = run_command(command)
        time.sleep(5)
        code = result['code']
    except CommandError:
        raise
    log.info('Network restart produced output:\n{o}'.format(o=result['output']))

    if code != 0:
        msg = 'Network services did not restart cleanly, exited with code: {c}'.format(c=code)
        log.error(msg)
        raise CommandError(msg)
    else:
        log.info('Successfully restarted networking!')
233453
def restart(self, container, **kwargs):
        
        self.push_log("Restarting container '{0}'.".format(container))
        super(DockerFabricClient, self).restart(container, **kwargs)