Start pydoc server
187383
def initialize(self):
        """"""
        QApplication.setOverrideCursor(QCursor(Qt.WaitCursor))
        QApplication.processEvents()
        self.start_server()
1067698
def start(self):
        
        logging.info("HTTP server: "
                     "Starting to listen for requests on '%s:%s'..." %
                     (self.conf['addr'], self.conf['port']))

        self.my_server = MyWSGIRefServer(host=self.conf['addr'],
                                         port=self.conf['port'],
                                         romana_http=self)

        self.http_thread = threading.Thread(
                    target = APP.run,
                    name   = "HTTP",
                    kwargs = {"quiet" : True, "server" : self.my_server})

        self.http_thread.daemon = True
        self.http_thread.start()
        time.sleep(1)
        if not self.wsgi_server_started:
            # Set the global flag indicating that everything should stop
            CURRENT_STATE._stop_all = True
716477
public void start() throws IOException {
    this.server.start();
    LOG.info("HdfsProxy server up at: " + sslAddr.getHostName() + ":"
        + sslAddr.getPort());
  }
447932
def start():
    """"""
    global app
    bottle.run(app, host=conf.WebHost, port=conf.WebPort,
               debug=conf.WebAutoReload, reloader=conf.WebAutoReload,
               quiet=conf.WebQuiet)
1060593
def run(self):
        
        define("port", default=self.port, help="Run on given port", type=int)
        define("host", default=self.host, help="Run on given host", type=str)
        define("debug", default=self.debug, help="True for development", type=bool)

        parse_command_line()

        print(Fore.GREEN + "Starting Bast Server....")
        print(Fore.GREEN + "Bast Server Running on %s:%s" % (options.host, options.port))

        application = Application(self.handler, debug=options.debug)
        server = HTTPServer(application)
        server.listen(options.port, options.host)
        IOLoop.current().start()
977594
def start(self):
        """"""
        c_out, c_err = (open(self.path('cmd.stdout'), 'w'),
                        open(self.path('cmd.stderr'), 'w'))
        kw = self.kw.copy()
        kw['stdout'] = c_out
        kw['stderr'] = c_err
        if not kw.get('cwd', None):
            kw['cwd'] = os.getcwd()
        pr = subprocess.Popen(self.cmd_args, **kw)
        with open(self.path('cmd.pid'), 'w') as f:
            f.write(str(pr.pid))
490923
def start_server(port):
    '''  '''
    s = socket(AF_INET, SOCK_STREAM)
    s.settimeout(None)

    try:
        from socket import SO_REUSEPORT
        s.setsockopt(SOL_SOCKET, SO_REUSEPORT, 1)
    except ImportError:
        s.setsockopt(SOL_SOCKET, SO_REUSEADDR, 1)

    s.bind(('', port))
    pydev_log.info("Bound to port :%s", port)

    try:
        s.listen(1)
        newSock, _addr = s.accept()
        pydev_log.info("Connection accepted")
        # closing server socket is not necessary but we don't need it
        s.shutdown(SHUT_RDWR)
        s.close()
        return newSock

    except:
        pydev_log.exception("Could not bind to port: %s\n", port)
1295965
def start(self):
        '''  '''
        self._app.run(host=self._host, port=self._port)
543082
def _start_console(self):
        
        self._remote_pipe = yield from asyncio_open_serial(self._get_pipe_name())
        server = AsyncioTelnetServer(reader=self._remote_pipe,
                                     writer=self._remote_pipe,
                                     binary=True,
                                     echo=True)
        self._telnet_server = yield from asyncio.start_server(server.run, self._manager.port_manager.console_host, self.console)
1060845
def _start(self):
        """"""
        assert self._tempdir is not None
        assert self._process is None
        self._process = subprocess.Popen(
            [
                self.paths.slapd,
                '-f', self._slapd_conf,
                '-h', self.uri,
                '-d', str(self.slapd_debug),
            ],
            stdout=sys.stdout,
            stderr=sys.stderr,
        )
        self._poll_slapd(timeout=self.max_server_startup_delay)
202648
def start_server(self, addr='', port=8000):
        
        if self._multiprocess_on:
            raise SanicPrometheusError(
                "start_server can not be used when multiprocessing " +
                "is turned on")
        start_http_server(addr=addr, port=port)
898290
def start(self):
        ""
        # register signals
        gevent.signal(signal.SIGINT, self._shutdown)

        # spawn the flush trigger
        def _flush_impl():
            while 1:
                gevent.sleep(self._stats.interval)

                # rotate stats
                stats = self._stats
                self._reset_stats()

                # send the stats to the sink which in turn broadcasts
                # the stats packet to one or more hosts.
                try:
                    self._sink.send(stats)
                except Exception, ex:
                    trace = traceback.format_tb(sys.exc_info()[-1])
                    self.error(''.join(trace))

        self._flush_task = gevent.spawn(_flush_impl)

        # start accepting connections
        self._sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM,
            socket.IPPROTO_UDP)
        self._sock.bind(self._bindaddr)
        while 1:
            try:
                data, _ = self._sock.recvfrom(MAX_PACKET)
                for p in data.split('\n'):
                    if p:
                        self._process(p)
            except Exception, ex:
                self.error(str(ex))
617800
def daemon_start(self):
        
        if daemon_status() == "SUN not running":
            subprocess.call("{0} &".format(self.cmd), shell=True)
1212444
def launch_server(message_handler, options):
    
    logger = logging.getLogger(__name__)
    if (options.debug):
        logger.setLevel(logging.DEBUG)

    if not options.monitor_port:
        logger.warning(
            "Monitoring not enabled. No monitor-port option defined.")
    else:
        threading.Thread(target=launch_monitor_server, args=(options.host, options.monitor_port, logger)).start()

    # Create the server, binding to specified host on configured port

    logger.info(
        'Starting server on host %s port %d Python version %s.%s.%s' % ((options.host, options.port) + sys.version_info[:3]))
    server = ThreadedTCPServer((options.host, options.port),
                       StreamHandler.create_handler(message_handler,
                                                    options.buffer_size,
                                                    logger))

    # Activate the server; this will keep running until you
    # interrupt the program with Ctrl-C
    try:
        server.serve_forever()
    except KeyboardInterrupt:
        logger.info("Ctrl-C, exiting...")
        os._exit(142)
23865
def run(self):
        
        self.configure()
        self.setup()
        self.update_dir()
        db.init_db(drop_all=True)
        self.out.log("Starting up the server...")
        config = get_config()
        with HerokuLocalWrapper(config, self.out, verbose=self.verbose) as wrapper:
            try:
                self.execute(wrapper)
            except KeyboardInterrupt:
                pass
            finally:
                os.chdir(self.original_dir)
                self.cleanup()
577731
def ensure_on():
    
    if get_status() == 'not-running':
        if config.dbserver.multi_user:
            sys.exit('Please start the DbServer: '
                     'see the documentation for details')
        # otherwise start the DbServer automatically; NB: I tried to use
        # multiprocessing.Process(target=run_server).start() and apparently
        # it works, but then run-demos.sh hangs after the end of the first
        # calculation, but only if the DbServer is started by oq engine (!?)
        subprocess.Popen([sys.executable, '-m', 'openquake.server.dbserver',
                          '-l', 'INFO'])

        # wait for the dbserver to start
        waiting_seconds = 30
        while get_status() == 'not-running':
            if waiting_seconds == 0:
                sys.exit('The DbServer cannot be started after 30 seconds. '
                         'Please check the configuration')
            time.sleep(1)
            waiting_seconds -= 1
106043
def start(self, streamer=False):
        
        if streamer and not general.socket_ready(self.task_in_url):  # started
            self.streamer = multiprocessing.Process(
                target=_streamer,
                args=(self.master_host, self.task_in_port, self.task_out_port))
            self.streamer.start()
        starting = []
        for host, cores in self.host_cores:
            if self.status(host)[0][1] == 'running':
                print('%s:%s already running' % (host, self.ctrl_port))
                continue
            ctrl_url = 'tcp://%s:%s' % (host, self.ctrl_port)
            if host == '127.0.0.1':  # localhost
                args = [sys.executable]
            else:
                args = ['ssh', host, self.remote_python]
            args += ['-m', 'openquake.baselib.workerpool',
                     ctrl_url, self.task_out_url, cores]
            starting.append(' '.join(args))
            po = subprocess.Popen(args)
            self.pids.append(po.pid)
        return 'starting %s' % starting