This commit is contained in:
who
2007-11-13 12:00:44 +01:00
parent d834a7af30
commit c796df2ac9
2 changed files with 25 additions and 5 deletions

View File

@ -15,18 +15,35 @@ import Event
MSG_TIME_CORRIDOR = 5
MSG_TIME_CORRIDOR = 120
EVENT_LIFE_TIME = 10
NULL_ADDRESS = '0.0.0.0'
TTL = 120
EXPIRY_PERIOD = 10
NAMESERVER = '88.198.170.2'
TSIGKEY = { "monitoring." : "+xLH8GuZnEgBljuIEM/iDA==" }
PIDFILE = "/tmp/yadyn.pid"
ADMIN_PWD = 'test123'
DEBUG = False
if DEBUG:
pid = 0
else:
pid = os.fork()
if pid:
pidFile = file(PIDFILE , mode='w')
pidFile.write("%i\n" % pid)
pidFile.close()
sys.exit(0)
Logger.openlog()
Logger.debugEnable()
if DEBUG:
Logger.debugEnable()
entries = shelve.open('entries', flag='c', writeback=True)
if len(entries) == 0:
@ -34,6 +51,8 @@ if len(entries) == 0:
statusMap = shelve.open('statusMap', flag='c', writeback=True)
try:
eventq = Queue.Queue()
dnsq = Queue.Queue()
@ -49,7 +68,7 @@ try:
dynReceiver = DynReceiver.DynReceiver(("", 8053), eventq)
dynReceiver.start()
expirer = Expirer.Expirer(entries, EVENT_LIFE_TIME, NULL_ADDRESS, dnsq)
expirer = Expirer.Expirer(entries, EVENT_LIFE_TIME, NULL_ADDRESS, EXPIRY_PERIOD, dnsq)
expirer.start()
cmdReceiver = CmdReceiver.CmdReceiver(("", 8023), entries, ADMIN_PWD)