'Exit the daemon process context.
:Return: ``None``
Close the daemon context. This performs the following steps:
* If this instance\'s `is_open` property is false, return
immediately. This makes it safe to call `close` multiple times
on an instance.
* If the `pidfile` attribute is not ``None``, exit its context
manager.
* Mark this instance as closed (for the purpose of future `open`
and `close` calls).'

def close(self):

    if (not self.is_open):
        return
    if (self.pidfile is not None):
        self.pidfile.__exit__()
    self._is_open = False
