close stdin/stdout/stderr on daemonize
authorJonathan Barber <j.barber@dundee.ac.uk>
Fri, 5 Sep 2008 18:09:35 +0000 (14:09 -0400)
committerAdrian Likins <alikins@redhat.com>
Fri, 5 Sep 2008 18:09:35 +0000 (14:09 -0400)
patch from Jonathan Barber <j.barber@dundee.ac.uk>

certmaster/utils.py

index 61721ac..22b0afb 100755 (executable)
@@ -48,6 +48,10 @@ def daemonize(pidfile=None):
     pid = os.fork()
     if pid > 0:
         sys.exit(0)
+    os.close(0)
+    os.close(1)
+    os.close(2)
+    os.cwd("/")
     os.setsid()
     os.umask(0)
     pid = os.fork()