コード例 #1
0
ファイル: backend.py プロジェクト: adolfoeliazat/GlobaLeaks
        if GLSettings.onionservice is not None:
            print("- http://%s%s" %
                  (GLSettings.onionservice, GLSettings.api_prefix))


application = service.Application('GLBackend')

if not GLSettings.nodaemon and GLSettings.logfile:
    name = os.path.basename(GLSettings.logfile)
    directory = os.path.dirname(GLSettings.logfile)

    gl_logfile = txlogfile.LogFile(name,
                                   directory,
                                   rotateLength=GLSettings.log_file_size,
                                   maxRotatedFiles=GLSettings.num_log_files)

    application.setComponent(txlog.ILogObserver,
                             GLLogObserver(gl_logfile).emit)

try:
    pre_listen_startup()

    service = GLService()
    service.setServiceParent(application)

except Exception as excep:
    fail_startup(excep)
    # Exit with non-zero exit code to signal systemd/system5
    sys.exit(55)
コード例 #2
0
        yield GLSettings.state.process_supervisor.maybe_launch_https_workers()

        GLSettings.start_jobs()
        GLSettings.start_services()

        GLSettings.print_listening_interfaces()


application = service.Application('GLBackend')

if not GLSettings.nodaemon and GLSettings.logfile:
    name = os.path.basename(GLSettings.logfile)
    directory = os.path.dirname(GLSettings.logfile)

    gl_logfile = txlogfile.LogFile(name, directory,
                                 rotateLength=GLSettings.log_file_size,
                                 maxRotatedFiles=GLSettings.num_log_files)

    application.setComponent(txlog.ILogObserver, GLLogObserver(gl_logfile).emit)

try:
    pre_listen_startup()

    service = GLService()
    service.setServiceParent(application)

except Exception as excep:
    fail_startup(excep)
    # Exit with non-zero exit code to signal systemd/systemV
    sys.exit(55)