Exemplo n.º 1
0
def main():
  localCfg = LocalConfiguration()
  localCfg.setUsageMessage(__doc__)

  positionalArgs = localCfg.getPositionalArguments()
  if len(positionalArgs) == 0:
    gLogger.fatal("You must specify which server to run!")
    sys.exit(1)

  serverName = positionalArgs[0]
  localCfg.setConfigurationForServer(serverName)
  localCfg.addMandatoryEntry("Port")
  # localCfg.addMandatoryEntry( "HandlerPath" )
  localCfg.addMandatoryEntry("/DIRAC/Setup")
  localCfg.addDefaultEntry("/DIRAC/Security/UseServerCertificate", "yes")
  localCfg.addDefaultEntry("LogLevel", "INFO")
  localCfg.addDefaultEntry("LogColor", True)
  resultDict = localCfg.loadUserData()
  if not resultDict['OK']:
    gLogger.initialize(serverName, "/")
    gLogger.error("There were errors when loading configuration", resultDict['Message'])
    sys.exit(1)

  includeExtensionErrors()

  serverToLaunch = ServiceReactor()
  result = serverToLaunch.initialize(positionalArgs)
  if not result['OK']:
    gLogger.error(result['Message'])
    sys.exit(1)

  result = serverToLaunch.serve()
  if not result['OK']:
    gLogger.error(result['Message'])
    sys.exit(1)
Exemplo n.º 2
0
positionalArgs = localCfg.getPositionalArguments()
if len(positionalArgs) == 0:
    gLogger.fatal("You must specify which server to run!")
    sys.exit(1)

serverName = positionalArgs[0]
localCfg.setConfigurationForServer(serverName)
localCfg.addMandatoryEntry("Port")
#localCfg.addMandatoryEntry( "HandlerPath" )
localCfg.addMandatoryEntry("/DIRAC/Setup")
localCfg.addDefaultEntry("/DIRAC/Security/UseServerCertificate", "yes")
localCfg.addDefaultEntry("LogLevel", "INFO")
localCfg.addDefaultEntry("LogColor", True)
resultDict = localCfg.loadUserData()
if not resultDict['OK']:
    gLogger.initialize(serverName, "/")
    gLogger.error("There were errors when loading configuration",
                  resultDict['Message'])
    sys.exit(1)

serverToLaunch = ServiceReactor()
result = serverToLaunch.initialize(positionalArgs)
if not result['OK']:
    gLogger.error(result['Message'])
    sys.exit(1)
result = serverToLaunch.serve()
if not result['OK']:
    gLogger.error(result['Message'])
    sys.exit(1)
Exemplo n.º 3
0
localCfg = LocalConfiguration()

positionalArgs = localCfg.getPositionalArguments()
if len(positionalArgs) == 0:
    gLogger.initialize("NOT SPECIFIED", "/")
    gLogger.fatal("You must specify which server to run!")
    sys.exit(1)

serverName = positionalArgs[0]
localCfg.setConfigurationForServer(serverName)
localCfg.addMandatoryEntry("Port")
#localCfg.addMandatoryEntry( "HandlerPath" )
localCfg.addMandatoryEntry("/DIRAC/Setup")
localCfg.addDefaultEntry("/DIRAC/Security/UseServerCertificate", "yes")
resultDict = localCfg.loadUserData()
if not resultDict['OK']:
    gLogger.initialize(serverName, "/")
    gLogger.error("There were errors when loading configuration",
                  resultDict['Message'])
    sys.exit(1)

serverToLaunch = ServiceReactor(positionalArgs)
result = serverToLaunch.initialize()
if not result['OK']:
    gLogger.error(result['Message'])
    sys.exit(1)
result = serverToLaunch.serve()
if not result['OK']:
    gLogger.error(result['Message'])
    sys.exit(1)