Shutdown the agency in gentel manner (terminate all the agents).
965676
def shutdown(self, stop_process=False):
        ''''''
        self.info("Agency.shutdown() called.")
        return self._shutdown(stop_process=stop_process, gentle=True)
590244
public void shutdown() {
    this.flowTriggerExecutorService.shutdown();
    this.cancelExecutorService.shutdown();
    this.timeoutService.shutdown();

    this.flowTriggerExecutorService.shutdownNow();
    this.cancelExecutorService.shutdownNow();
    this.timeoutService.shutdownNow();

    this.triggerProcessor.shutdown();
    this.triggerPluginManager.shutdown();
    this.cleaner.shutdown();
  }
509978
public function shutdown()
    {
        $this->shutdown = true;
        $this->redis->hmset(self::redisKey($this), 'shutdown', true);

        Event::fire(Event::WORKER_SHUTDOWN, $this);
    }
306843
final static void stop() {
		if (lifeCycle.getStatus().equals(RunStatus.RUNNING) || lifeCycle.getStatus().equals(RunStatus.DISABLED)) {
			lifeCycle.setStatus(RunStatus.STOPPED);
			Log.info("Preparing to shutdown Audit4j...");

			Log.info("Closing Streams...");
			auditStream.close();

			Log.info("Shutdown handlers...");
			for (Handler handler : configContext.getHandlers()) {
				handler.stop();
				Log.info(handler.getClass().getName() + " shutdown.");
			}

			Log.info("Disposing configurations...");
			configContext = null;
			conf = null;
			Log.info("Audit4j shutdown completed.");
		} else {
			Log.info("No active Audit4j instance. Cancelling shutdown request.");
		}
	}
478239
def on_shutdown(self, broker):
        """"""
        _v and LOG.debug('%r.on_shutdown(%r)', self, broker)
        fire(self, 'shutdown')
        for handle, (persist, fn) in self._handle_map.iteritems():
            _v and LOG.debug('%r.on_shutdown(): killing %r: %r', self, handle, fn)
            fn(Message.dead(self.broker_shutdown_msg))
886660
def terminate_all(self):
        
        logger.info('Job {0} terminating all currently running tasks'.format(self.name))
        for task in self.tasks.itervalues():
            if task.started_at and not task.completed_at:
                task.terminate()
1099481
def shutdown(self):
        """"""
        for wsock in self.wsocks:
            wsock.shutdown()
        for api in self.apis:
            api.shutdown()
572812
def shutdown(self):
        """"""
        self.stop_all_periodic_tasks()
        for channel in self._bcm_sockets:
            log.debug("Closing bcm socket for channel {}".format(channel))
            bcm_socket = self._bcm_sockets[channel]
            bcm_socket.close()
        log.debug("Closing raw can socket")
        self.socket.close()
959165
public void terminate() {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.entry(tc, "terminate");
        }

        AsyncLibrary.shutdown();
        groups.clear();

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.exit(tc, "terminate");
        }
    }
821295
def terminate_all(self):
        """"""
        for worker in self._workers:
            worker.terminate()

        # for thread in self._threads:
        #     try:
        #         thread.terminate()
        #         thread.wait()
        #     except Exception:
        #         pass
        self._queue_workers = deque()
232118
final public function shutdown() : void
    {
        $this->__call('shutdown');
        Master::wait($this->backend->process()->pid ?? -2);
    }
1100158
public function shutdown()
    {
        $frontendHelpers = $this->frontendHelperManager->getActivatedFrontendHelpers();

        foreach ($frontendHelpers as $frontendHelper) {
            /** @var FrontendHelper $frontendHelper */
            $frontendHelper->deactivate();
        }
    }
581128
protected synchronized void destroyAgent (int agentId)
    {
        Agent agent = null;
        agent = _agents.remove(agentId);

        if (agent == null) {
            log.warning("Lost an agent, id " + agentId);
        } else {
            try {
                agent.stop();
            } catch (Throwable t) {
                log.warning("Stopping an agent caused an exception", t);
            }
            SafeSubscriber<AgentObject> subscriber = _subscribers.remove(agentId);
            if (subscriber == null) {
                log.warning("Lost a subscriber for agent " + agent);
            } else {
                subscriber.unsubscribe(_ctx.getDObjectManager());
            }
            _bureauService.agentDestroyed(agentId);
        }
    }
1002717
def shutdown(self):
        

        if not self._exited:
            self._exited = True
            _shutdown_pipe(self._pipe)
            self._task.stop()
            raise SystemExit
876761
public void stop() {
        if (future != null) {
            future.cancel(true);
        }
        if (executor != null) {
            executor.shutdownNow();
        }
    }
659377
def _killall(self, force=False):
        """"""
        for_termination = []

        for n, p in iteritems(self._processes):
            if 'returncode' not in p:
                for_termination.append(n)

        for n in for_termination:
            p = self._processes[n]
            signame = 'SIGKILL' if force else 'SIGTERM'
            self._system_print("sending %s to %s (pid %s)\n" %
                               (signame, n, p['pid']))
            if force:
                self._env.kill(p['pid'])
            else:
                self._env.terminate(p['pid'])
19055
def shutdown(self, exitcode=0, exitmsg=None):
        '''
        
        '''
        self.action_log_info('Shutting down')
        if hasattr(self, 'minion') and hasattr(self.minion, 'destroy'):
            self.minion.destroy()
        super(Minion, self).shutdown(
            exitcode, ('The Salt {0} is shutdown. {1}'.format(
                self.__class__.__name__, (exitmsg or '')).strip()))