Revision 7c62bd54

b/setup.py
74 74
    entry_points = {
75 75
     'console_scripts': [
76 76
         'synnefo-manage = synnefo.manage:main',
77
         'synnefo-dispatcher = synnefo.logic.dispatcher:main',
77
         'synnefo-dispatcher = synnefo.logic.dispatcher:scriptmain',
78 78
         'synnefo-burnin = synnefo.tools.burnin:main',
79 79
         'synnefo-admin = synnefo.tools.admin:main',
80 80
         'synnefo-cloud = synnefo.tools.cloud:main',
b/synnefo/logic/dispatcher.py
440 440
    if opts.debug:
441 441
        debug_mode()
442 442
        return
443
    
443

  
444 444
    files_preserve = []
445 445
    for handler in log.handlers:
446 446
        stream = getattr(handler, 'stream')
447 447
        if stream and hasattr(stream, 'fileno'):
448 448
            files_preserve.append(handler.stream)
449
    
449

  
450 450
    daemon_context = daemon.DaemonContext(
451 451
        files_preserve=files_preserve,
452 452
        umask=022)
453
    
453

  
454 454
    daemon_context.open()
455 455

  
456 456
    # Catch every exception, make sure it gets logged properly
......
461 461
        raise
462 462

  
463 463

  
464
if __name__ == "__main__":
464
def scriptmain():
465 465
    dictConfig(settings.DISPATCHER_LOGGING)
466 466
    sys.exit(main())
467 467

  
468
if __name__ == "__main__":
469
    scriptmain()
470

  
468 471
# vim: set sta sts=4 shiftwidth=4 sw=4 et ai :

Also available in: Unified diff