From 1e8dac6da00d176aa6cf10053e5a29c5c26b30f9 Mon Sep 17 00:00:00 2001 From: Mark Sapiro Date: Mon, 15 Feb 2010 10:59:20 -0800 Subject: When daemonizing mailmanctl, we now ensure terminal files are closed. --- NEWS | 3 +++ bin/mailmanctl | 9 ++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 1218855b..546248ff 100644 --- a/NEWS +++ b/NEWS @@ -12,6 +12,9 @@ Here is a history of user visible changes to Mailman. Bug #500952 and Bug #500955. Bug Fixes and other patches + + - When daemonizing mailmanctl, we now ensure terminal files are closed. + - Fixed a bug in pipermail archiving that caused fallback threading by subject to fail. Bug #266572. diff --git a/bin/mailmanctl b/bin/mailmanctl index 473c9470..613f909f 100644 --- a/bin/mailmanctl +++ b/bin/mailmanctl @@ -1,6 +1,6 @@ #! @PYTHON@ -# Copyright (C) 2001-2006 by the Free Software Foundation, Inc. +# Copyright (C) 2001-2010 by the Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -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 -- cgit v1.2.3