Use the termination script to stop all the servers (this cleans up the volumes)
350578
def stop_all
      @servers.each do |s|
        terminate_server(s) if s.state == 'operational' || s.state == 'stranded'
      end
      @servers.each { |s| s.wait_for_state("stopped") }
      # unset dns in our local cached copy..
      @servers.each { |s| s.params['dns-name'] = nil }
    end
919830
def terminate(self):
        """"""
        logger.info("deleting entire server %s" % self)
        self.close()
        try:
            shutil.rmtree(self.basedir)
            logger.info("deleted server under %s" % self.basedir)
            # delete everything from self, so that using this object fails results
            # in an error as quickly as possible
            for val in self.__dict__.keys():
                try:
                    delattr(self, val)
                except:
                    pass
        except Exception, e:
            logger.warning("failed to delete SessionServer: %s" % (e))
679829
def cleanup(self):
        
        if self.local_port is not None:
            logger.debug(("Stopping ssh tunnel {0}:{1}:{2} for "
                          "{3}@{4}".format(self.local_port,
                                           self.remote_address,
                                           self.remote_port,
                                           self.username,
                                           self.address)))
            if self.forward is not None:
                self.forward.stop()
                self.forward.join()
            if self.transport is not None:
                self.transport.close()
238746
def stop_containers(self):
        
        while len(self._containers):
            container = self._containers.pop()
            try:
                container.kill(signal.SIGKILL)
            except docker.errors.APIError:  # probably doesn't exist anymore
                pass
137876
private void stop() {
		for (int i = 0; i < mDownloadDispatchers.length; i++) {
			if (mDownloadDispatchers[i] != null) {
				mDownloadDispatchers[i].quit();
			}
		}
	}
977091
def close_all(self):
        """"""
        for host, conns in self._cm.get_all().items():
            for h in conns:
                self._cm.remove(h)
                h.close()
1340067
def stop():
    
    global global_server
    if global_server is not None:
        ioloop = global_server.ioloop
        def stop_ioloop():
            ioloop.stop()
            ioloop.close()
        global_server.ioloop.add_callback(stop_ioloop)
        global_server = None
344608
def stop(self):
        
        if self._stack:
            try:
                self._stack.teardown()
            except Exception:
                self.fatal(sys.exc_info())

        super().stop()
758177
def stop(self):
        
        for subscript in list(self.scripts.values()):
            subscript.stop()
        print(('--- stopping: ', self.name))
        self._abort = True
1179861
def stop(self):
        
        self.is_alive = False
        self.server_close()
        flows.Global.LOGGER.info("Server Stops " + (str(self.server_address)))
1235198
def stop_and_destroy(self, sync=True):
        
        def _self_destruct():
            """destroy the server and all storages attached to it."""

            # try_it_n_times util is used as a convenience because
            # Servers and Storages can fluctuate between "maintenance" and their
            # original state due to several different reasons especially when
            # destroying infrastructure.

            # first destroy server
            try_it_n_times(operation=self.destroy,
                           expected_error_codes=['SERVER_STATE_ILLEGAL'],
                           custom_error='destroying server failed')

            # storages may be deleted instantly after server DELETE
            for storage in self.storage_devices:
                try_it_n_times(operation=storage.destroy,
                               expected_error_codes=['STORAGE_STATE_ILLEGAL'],
                               custom_error='destroying storage failed')

        if sync:
            self.populate()

        # server is either starting or stopping (or error)
        if self.state in ['maintenance', 'error']:
            self._wait_for_state_change(['stopped', 'started'])

        if self.state == 'started':
            try_it_n_times(operation=self.stop,
                           expected_error_codes=['SERVER_STATE_ILLEGAL'],
                           custom_error='stopping server failed')

            self._wait_for_state_change(['stopped'])

        if self.state == 'stopped':
            _self_destruct()
        else:
            raise Exception('unknown server state: ' + self.state)
1118268
protected static function exitAndClearAll()
    {
        foreach (self::$_workers as $worker) {
            $socket_name = $worker->getSocketName();
            if ($worker->transport === 'unix' && $socket_name) {
                list(, $address) = explode(':', $socket_name, 2);
                @unlink($address);
            }
        }
        @unlink(self::$pidFile);
        self::log("Workerman[" . basename(self::$_startFile) . "] has been stopped");
        if (self::$onMasterStop) {
            call_user_func(self::$onMasterStop);
        }
        exit(0);
    }
1245962
def stop(self):
        
        self.running = False
        # stop the command server
        try:
            self.commands_thread.kill()
        except:  # noqa e722
            pass

        try:
            self.lock.set()
            if self.config["debug"]:
                self.log("lock set, exiting")
            # run kill() method on all py3status modules
            for module in self.modules.values():
                module.kill()
        except:  # noqa e722
            pass
613551
def cleanup(self):
        
        for future in self.futures:
            future.cancel()
        self.executor.shutdown(wait=10)
        if self.ssh.get_transport() != None:
            self.ssh.close()
487508
def stop(self):
        """"""
        self._done()
        if self._server:
            self._server.stop()
            self._server = None
        log.info('Stop!')
801243
def _finalCleanup(self):
        
        for conn in self._connections.values():
            conn.releaseConnectionResources()
        assert not self._connections
1326700
def stop(args):
  """"""
  if args.local:
    raise ValueError("Stopping commands locally is not supported (please kill them yourself)")
  jm = setup(args)
  jm.stop_jobs(get_ids(args.job_ids))