Apply 15_mailmanctl_daemonize.patch
authorMichael Spang <mspang@uwaterloo.ca>
Thu, 13 Sep 2007 00:32:51 +0000 (20:32 -0400)
committerMichael Spang <mspang@uwaterloo.ca>
Thu, 13 Sep 2007 00:32:51 +0000 (20:32 -0400)
bin/mailmanctl

index 473c947..218e732 100644 (file)
@@ -417,6 +417,13 @@ def main():
         # won't be opening any terminal devices, don't do the ultra-paranoid
         # suggestion of doing a second fork after the setsid() call.
         os.setsid()
+
+        # Be sure to close any open std{in,out,err}
+        devnull = os.open('/dev/null', 0)
+        os.dup2(devnull, 0)
+        os.dup2(devnull, 1)
+        os.dup2(devnull, 2)
+
         # Instead of cd'ing to root, cd to the Mailman installation home
         os.chdir(mm_cfg.PREFIX)
         # Set our file mode creation umask