Revision 15486fa7 daemons/ganeti-masterd

b/daemons/ganeti-masterd
446 446
                    noclose_fds=[master.fileno()])
447 447

  
448 448
  utils.WritePidFile(constants.MASTERD_PID)
449

  
450
  utils.SetupLogging(constants.LOG_MASTERDAEMON, debug=options.debug,
451
                     stderr_logging=not options.fork)
452

  
453
  rpc.Init()
454 449
  try:
455
    logging.info("ganeti master daemon startup")
450
    utils.SetupLogging(constants.LOG_MASTERDAEMON, debug=options.debug,
451
                       stderr_logging=not options.fork)
456 452

  
457
    # activate ip
458
    master_node = ssconf.SimpleConfigReader().GetMasterNode()
459
    if not rpc.RpcRunner.call_node_start_master(master_node, False):
460
      logging.error("Can't activate master IP address")
453
    logging.info("Ganeti master daemon startup")
461 454

  
462
    master.setup_queue()
455
    rpc.Init()
463 456
    try:
464
      master.serve_forever()
457
      # activate ip
458
      master_node = ssconf.SimpleConfigReader().GetMasterNode()
459
      if not rpc.RpcRunner.call_node_start_master(master_node, False):
460
        logging.error("Can't activate master IP address")
461

  
462
      master.setup_queue()
463
      try:
464
        master.serve_forever()
465
      finally:
466
        master.server_cleanup()
465 467
    finally:
466
      master.server_cleanup()
467
      utils.RemovePidFile(constants.MASTERD_PID)
468
      rpc.Shutdown()
468 469
  finally:
469
    rpc.Shutdown()
470
    utils.RemovePidFile(constants.MASTERD_PID)
470 471

  
471 472

  
472 473
if __name__ == "__main__":

Also available in: Unified diff