Пример #1
0
    def start(self):
        """
        Start fork loop.
        """

        # Load configuration here to make sure that everything for it is loaded
        self.cfg = getConfiguration()

        # Must import here because we don't have DB on bootup yet
        from Globals import DB
        self.database = IDatabaseHooks(DB)

        # SIGCHLD tells us that child process has really died and we can spawn
        # new child
        registerHandler(signal.SIGCHLD, self._waitChildToDieAndScheduleNew)

        # With SIGUSR1 child can tell that it dies by request, not by exception
        # etc.
        registerHandler(signal.SIGUSR1, self._childIsGoingToDie)

        self.loop()
Пример #2
0
 def __init__(self, context):
     self.context = IDatabaseHooks(context.storage)