2 # vim: set encoding=utf-8 et sw=4 sts=4 :
5 import logging ; log = logging.getLogger('pymind')
7 from pymin.pymindaemon import PyminDaemon
8 from pymin.dispatcher import Handler
9 from pymin.service import load_service, LoadError
18 def build_root(config):
19 # TODO check services dependencies
21 for service in config.services:
23 s = load_service(service, config.services_dirs)
25 log.error("Can't find service called '%s'\n", service)
26 sys.exit(EXIT_NO_SERVICE)
29 for name, service in services.items():
30 setattr(root, name, service.get_service(config))
35 f = file("/proc/sys/net/ipv4/ip_forward","w")
38 except (IOError, OSError), e:
39 log.warning("Can't set ip_forward: %s", e)
41 PyminDaemon(build_root(config), config.bind_addr).run()