Files
yadyn/server/yadyn
2007-11-12 11:17:25 +01:00

52 lines
990 B
Python
Executable File

#!/usr/bin/python
import Queue
import time
import shelve
import DynHandler
# import DnsHandler
import Expirer
import DynReceiver
import Entry
import Event
MSG_TIME_CORRIDOR = 5
EVENT_LIFE_TIME = 10
NULL_ADDRESS = '0.0.0.0'
ZONE = 'contextmatters.de'
NAME = 'serve'
TTL = 120
NAMESERVER = '127.0.0.1'
TSIGKEY = { "monitoring." : "HYHN8l/dg1+q6QLOURp2qw==" }
PIDFILE = "/tmp/yadyn.pid"
entries = shelve.open('entries', flag='c', writeback=True)
if len(entries) == 0:
entries['testhost'] = Entry.Entry('testhost', 'test123', 'test.test.de')
try:
Event.Event.setParams(entries, MSG_TIME_CORRIDOR)
q = Queue.Queue()
dynHandler = DynHandler.DynHandler(q)
dynHandler.start()
dynReceiver = DynReceiver.DynReceiver(("", 8053), q)
dynReceiver.start()
expirer = Expirer.Expirer(entries, EVENT_LIFE_TIME, NULL_ADDRESS)
expirer.start()
while True:
entries.sync()
time.sleep(10)
finally:
print "Closing shelf"
entries.close()