kolibri/utils/cli.py
def stop():
    """
    Stops the server unless it isn't running
    """
    try:
        pid, __, __ = server.get_status()
        server.stop(pid=pid)
        stopped = True
        if conf.OPTIONS["Server"]["CHERRYPY_START"]:
            logger.info("Kolibri server has successfully been stopped.")
        else:
            logger.info("Kolibri background services have successfully been stopped.")
    except server.NotRunning as e:
        verbose_status = "{msg:s} ({code:d})".format(
            code=e.status_code, msg=status.codes[e.status_code]
        )
        if e.status_code == server.STATUS_STOPPED:
            logger.info("Already stopped: {}".format(verbose_status))
            stopped = True
        elif e.status_code == server.STATUS_STARTING_UP:
            logger.error("Not stopped: {}".format(verbose_status))
            sys.exit(e.status_code)
        else:
            logger.error(
                "During graceful shutdown, server says: {}".format(verbose_status)
            )
            logger.error("Not responding, killing with force")
            server.stop(force=True)
            stopped = True

    if stopped:
        sys.exit(0)

    Stops the server unless it isn't running
    
Stops the server unless it isn't running
Stops the server unless it isn ' t running
def stop():
    try:
        pid, __, __ = server.get_status()
        server.stop(pid=pid)
        stopped = True
        if conf.OPTIONS["Server"]["CHERRYPY_START"]:
            logger.info("Kolibri server has successfully been stopped.")
        else:
            logger.info("Kolibri background services have successfully been stopped.")
    except server.NotRunning as e:
        verbose_status = "{msg:s} ({code:d})".format(
            code=e.status_code, msg=status.codes[e.status_code]
        )
        if e.status_code == server.STATUS_STOPPED:
            logger.info("Already stopped: {}".format(verbose_status))
            stopped = True
        elif e.status_code == server.STATUS_STARTING_UP:
            logger.error("Not stopped: {}".format(verbose_status))
            sys.exit(e.status_code)
        else:
            logger.error(
                "During graceful shutdown, server says: {}".format(verbose_status)
            )
            logger.error("Not responding, killing with force")
            server.stop(force=True)
            stopped = True
    if stopped:
        sys.exit(0)
def stop ( ) : try : pid , __ , __ = server . get_status ( ) server . stop ( pid = pid ) stopped = True if conf . OPTIONS [ "Server" ] [ "CHERRYPY_START" ] : logger . info ( "Kolibri server has successfully been stopped." ) else : logger . info ( "Kolibri background services have successfully been stopped." ) except server . NotRunning as e : verbose_status = "{msg:s} ({code:d})" . format ( code = e . status_code , msg = status . codes [ e . status_code ] ) if e . status_code == server . STATUS_STOPPED : logger . info ( "Already stopped: {}" . format ( verbose_status ) ) stopped = True elif e . status_code == server . STATUS_STARTING_UP : logger . error ( "Not stopped: {}" . format ( verbose_status ) ) sys . exit ( e . status_code ) else : logger . error ( "During graceful shutdown, server says: {}" . format ( verbose_status ) ) logger . error ( "Not responding, killing with force" ) server . stop ( force = True ) stopped = True if stopped : sys . exit ( 0 )
Stops the server unless it isn't running
Stops the server unless it isn ' t running
"""
    Stops the server unless it isn't running
    """