summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Barber <j.barber@dundee.ac.uk>2008-09-05 14:09:35 -0400
committerAdrian Likins <alikins@redhat.com>2008-09-05 14:09:35 -0400
commitd512d680d6fb50cdeae615492fb35741d44bd3a4 (patch)
tree87d6e07607595a3bd4dfdcb1246725e11f349629
parent37f80fb5318f344c4a0db4b53d6e314a5223ddb2 (diff)
downloadcertmaster-d512d680d6fb50cdeae615492fb35741d44bd3a4.zip
certmaster-d512d680d6fb50cdeae615492fb35741d44bd3a4.tar.gz
certmaster-d512d680d6fb50cdeae615492fb35741d44bd3a4.tar.xz
close stdin/stdout/stderr on daemonize
patch from Jonathan Barber <j.barber@dundee.ac.uk>
-rwxr-xr-xcertmaster/utils.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/certmaster/utils.py b/certmaster/utils.py
index 61721ac..22b0afb 100755
--- a/certmaster/utils.py
+++ b/certmaster/utils.py
@@ -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()