'Indicate that daemonization has happened and change the PID so that the
value written to the pidfile can be tested in the daemonization case.'

def daemonize(self, reactor):

    self.daemon = True
    self.patch(os, 'getpid', (lambda : (self.pid + 1)))
