'Detach a process from the controlling terminal and run it in the
background as a daemon.
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/278731'

def __createDaemon(self):

    self._rebindSignal(signal.SIGHUP, signal.SIG_IGN)
    try:
        pid = os.fork()
    except OSError as e:
        return (False, (e.errno, e.strerror))
    if (pid == 0):
        os.setsid()
        try:
            pid = os.fork()
        except OSError as e:
            return (False, (e.errno, e.strerror))
        if (pid == 0):
            os.chdir('/')
        else:
            os._exit(0)
    else:
        return None
    try:
        maxfd = os.sysconf('SC_OPEN_MAX')
    except (AttributeError, ValueError):
        maxfd = 256
    if (sys.version_info[0:3] == (3, 4, 0)):
        urandom_fd = os.open('/dev/urandom', os.O_RDONLY)
        for fd in range(0, maxfd):
            try:
                if (not os.path.sameopenfile(urandom_fd, fd)):
                    os.close(fd)
            except OSError:
                pass
        os.close(urandom_fd)
    else:
        os.closerange(0, maxfd)
    os.open('/dev/null', os.O_RDONLY)
    os.open('/dev/null', os.O_RDWR)
    os.open('/dev/null', os.O_RDWR)
    return (True,)
