diff --git a/alignak/daemon.py b/alignak/daemon.py index 459aaba7d..ebc4cc3d5 100644 --- a/alignak/daemon.py +++ b/alignak/daemon.py @@ -1468,7 +1468,7 @@ def daemonize(self): # pragma: no cover, not for unit tests... print("Daemonizing %s..." % self.name) # Set umask - os.umask(UMASK) + mask = os.umask(UMASK) # Close all file descriptors except the one we need self.pre_log.append(("DEBUG", "Closing file descriptors...")) @@ -1505,6 +1505,8 @@ def fork_then_exit_parent(level, error_message): self.pid = os.getpid() self.pre_log.append(("INFO", "We are now fully daemonized :) pid=%d" % self.pid)) + # Reset umask + os.umask(mask) return True