summaryrefslogtreecommitdiffstats
path: root/wallace/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'wallace/__init__.py')
-rw-r--r--wallace/__init__.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/wallace/__init__.py b/wallace/__init__.py
index 57443cd..4a22e3e 100644
--- a/wallace/__init__.py
+++ b/wallace/__init__.py
@@ -618,7 +618,7 @@ class WallaceDaemon:
# Give up the session, all control,
# all open file descriptors, see #5151
os.chdir("/")
- os.umask(0)
+ old_umask = os.umask(0)
os.setsid()
pid = os.fork()
@@ -637,6 +637,8 @@ class WallaceDaemon:
os.open(os.devnull, os.O_WRONLY)
os.open(os.devnull, os.O_WRONLY)
+ os.umask(old_umask)
+
log.remove_stdout_handler()
self.set_signal_handlers()
self.write_pid()