restarts a dedicated process
    :return:
10943
def kill_process(modeladmin, request, queryset):
    
    for process in queryset:
        process.stop(signum=signal.SIGKILL)
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();
        }
    }
685575
def __wait_and_restart():
    
    log.info('Restarting server')
    sleep(1)
    # We can use the default event loop here because this
    # is actually running in a thread. We use aiohttp here because urllib is
    # painful and we don’t have `requests`.
    loop = asyncio.new_event_loop()
    loop.run_until_complete(_resin_supervisor_restart())
70666
def __start(self):
        
        thread = Thread(target=self.__loop, args=())
        thread.daemon = True  # daemonize thread
        thread.start()
        self.__enabled = True
170440
def service_restart(name):
    '''
    
    '''
    cmd = 'restart ' + name

    # Send the command to execute
    out, err = DETAILS['server'].sendline(cmd)

    # "scrape" the output and return the right fields as a dict
    return parse(out)
113603
async def restart(request):
    
    def wait_and_restart():
        log.info('Restarting server')
        sleep(1)
        os.system('kill 1')
    Thread(target=wait_and_restart).start()
    return web.json_response({"message": "restarting"})
116147
def restart(gandi, resource, background, force):
    
    output_keys = ['id', 'type', 'step']

    possible_resources = gandi.paas.resource_list()
    for item in resource:
        if item not in possible_resources:
            gandi.echo('Sorry PaaS instance %s does not exist' % item)
            gandi.echo('Please use one of the following: %s' %
                       possible_resources)
            return

    if not force:
        instance_info = "'%s'" % ', '.join(resource)
        proceed = click.confirm("Are you sure to restart PaaS instance %s?" %
                                instance_info)

        if not proceed:
            return

    opers = gandi.paas.restart(resource, background)
    if background:
        for oper in opers:
            output_generic(gandi, oper, output_keys)

    return opers
1005562
def start(self):
        
        if self.is_started:
            raise EasyProcessError(self, 'process was started twice!')

        if self.use_temp_files:
            self._stdout_file = tempfile.TemporaryFile(prefix='stdout_')
            self._stderr_file = tempfile.TemporaryFile(prefix='stderr_')
            stdout = self._stdout_file
            stderr = self._stderr_file

        else:
            stdout = subprocess.PIPE
            stderr = subprocess.PIPE

        cmd = list(map(uniencode, self.cmd))

        try:
            self.popen = subprocess.Popen(cmd,
                                          stdout=stdout,
                                          stderr=stderr,
                                          cwd=self.cwd,
                                          env=self.env,
                                          )
        except OSError as oserror:
            log.debug('OSError exception: %s', oserror)
            self.oserror = oserror
            raise EasyProcessError(self, 'start error')
        self.is_started = True
        log.debug('process was started (pid=%s)', self.pid)
        return self
1351955
function restartOnProcess( index ) {
  log( 'Attempting to restart ' + index + '...' );

  // generate delegate function to pass with proper contexts.
  var startRequest = (function(context, index) {
    return function(cb) {
        startForeverWithIndex.call(context, index, cb);
    };
  }(this, index));

  done = this.async();
  findProcessWithIndex( index, function(process) {
    if(typeof process !== 'undefined') {
      log(forever.format(true,[process]));
      forever.restart(index, false);
      done();
    }
    else {
      log(index + ' not found in list of processes in forever. Starting new instance...');
      startRequest(done);
    }
  });
}
609933
def restart
      invoke :stop, :all => input[:all], :apps => input[:apps]

      line unless quiet?

      input[:apps].each do |app|
        unless input[:command].nil?
          app.command = input[:command]
        end
        app.update!
      end

      invoke :start, :all => input[:all], :apps => input[:apps],
        :debug_mode => input[:debug_mode]
    end
953361
def restart(self):
        
        self.master_clients = 0
        self.create_new_client_if_empty = False
        for i in range(len(self.clients)):
            client = self.clients[-1]
            try:
                client.shutdown()
            except Exception as e:
                QMessageBox.warning(self, _('Warning'),
                    _("It was not possible to restart the IPython console "
                      "when switching to this project. The error was<br><br>"
                      "<tt>{0}</tt>").format(e), QMessageBox.Ok)
            self.close_client(client=client, force=True)
        self.create_new_client(give_focus=False)
        self.create_new_client_if_empty = True
59003
def restart_stopped_apps():
    '''
        
    '''
    cozy_apps = monitor.status(only_cozy=True)
    for app in cozy_apps.keys():
        state = cozy_apps[app]
        if state == 'up':
            next
        elif state == 'down':
            print 'Start {}'.format(app)
            rebuild_app(app, force=False)
            monitor.start(app)
617522
protected function restart()
    {
        if ($this->process->isStarted()) {
            event(new WorkerProcessRestarting($this));
        }

        $this->start($this->output);
    }
33229
def __start(self):
        
        logging.debug("starting %i" % id(self))
        self.__kill_if_not_shut_properly()
        self.FNULL = open(os.devnull, 'w')
        flags = self.__flags()
        cmd = [hoverfly] + flags
        if self._showCmd:
            print(cmd)
        self._process = Popen(
            [hoverfly] +
            flags,
            stdin=self.FNULL,
            stdout=self.FNULL,
            stderr=subprocess.STDOUT)
        start = time.time()
        while time.time() - start < 1:
            try:
                url = "http://%s:%i/api/health" % (self._host, self._adminPort)
                r = self._session.get(url)
                j = r.json()
                up = "message" in j and "healthy" in j["message"]
                if up:
                    logging.debug("has pid %i" % self._process.pid)
                    self.__writepid(self._process.pid)
                    return self._process
                else:
                    time.sleep(1/100.0)
            except:
                # import traceback
                # traceback.print_exc()
                # wait 10 ms before trying again
                time.sleep(1/100.0)
                pass

        logging.error("Could not start hoverfly!")
        raise ValueError("Could not start hoverfly!")
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
1150991
def restart(name):
    '''
    
    '''
    cmd = '/usr/sbin/svcadm restart {0}'.format(name)
    if not __salt__['cmd.retcode'](cmd, python_shell=False):
        # calling restart doesn't clear maintenance
        # or tell us that the service is in the 'online' state
        return start(name)
    return False
841843
def request_restart(self, req, msg):
        
        if self._restart_queue is None:
            raise FailReply("No restart queue registered -- cannot restart.")

        f = tornado_Future()

        @gen.coroutine
        def _restart():
            # .put should never block because queue should have no size limit
            self._restart_queue.put_nowait(self)
            req.reply('ok')
            raise AsyncReply

        self.ioloop.add_callback(lambda: chain_future(_restart(), f))
        return f