#!/usr/libexec/isilon/isi_upgrade_d
#
# Copyright C 2002-2003 by Isilon Systems, Inc. All rights not expressly
# granted herein are reserved.
# Created in the United States of America.
# 
# This digital media is protected by U.S. and international copyright and
# intellectual property laws. Unless otherwise specified, all information
# and screens appearing as part of this digital medium, including
# software, services, documents, text, images, icons, and logos design;
# the selection, assembly, arrangement, and design thereof; and the code
# that enables its presentation, are the sole property of Isilon Systems,
# Inc.
# 
# Except as otherwise required by applicable law, no part of any
# copyrighted material may be reproduced, modified, translated,
# distributed, published, or transmitted by any means, electronic or
# mechanical, for any purpose, without the prior written consent of Isilon
# Systems. 
#  
# Isilon and Isilon Systems are registered trademarks of Isilon Systems,
# Inc.  Legion is a trademark of Isilon Systems, Inc.  All other
# trademarks and registered trademarks are the property of their
# respective holders.
#
# $Id: isi_upgrade_d 60606 2006-12-12 01:54:52Z jroberson $
import sys
import isi.app.daemon as daemon
import isi.net.rpc as rpc
import isi.net.transport as transport
import isi.sys.update.engine as engine
import isi.sys.update.config as config
import isi.sys.update.util as util

#import logging
#log = logging.getLogger('net.rpc')
#log.setLevel(logging.DEBUG)
#log.addHandler(logging.FileHandler('/tmp/isi_update.txt'))

class IsiUpdate:
    def __init__(self):
        try:
            self._engine = engine.Engine()
	    self.server = rpc.RPCServer(transport.TCPTransport('', config.PORT), 
	                                self._engine)
            self.server.serve_forever()
        except:
            util.Logging.exception()

if __name__ == '__main__':
    daemon.startstop()
    IsiUpdate()
