summaryrefslogtreecommitdiff
path: root/src/mailman/bin/master.py
diff options
context:
space:
mode:
authorBarry Warsaw2015-01-02 10:19:52 -0500
committerBarry Warsaw2015-01-02 10:19:52 -0500
commit27e7d553d29e5a547d8164b658f5e8881b026cb2 (patch)
tree88a3709b372a3880931de614afaf587140ab6d5e /src/mailman/bin/master.py
parentc387b653bab7001b00dbb62c1aec67cecae8ce4b (diff)
downloadmailman-27e7d553d29e5a547d8164b658f5e8881b026cb2.tar.gz
mailman-27e7d553d29e5a547d8164b658f5e8881b026cb2.tar.zst
mailman-27e7d553d29e5a547d8164b658f5e8881b026cb2.zip
Diffstat (limited to 'src/mailman/bin/master.py')
-rw-r--r--src/mailman/bin/master.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/mailman/bin/master.py b/src/mailman/bin/master.py
index 6dc2a451f..e7efdc537 100644
--- a/src/mailman/bin/master.py
+++ b/src/mailman/bin/master.py
@@ -353,7 +353,7 @@ class Loop:
# Set the environment variable which tells the runner that it's
# running under bin/master control. This subtly changes the error
# behavior of bin/runner.
- os.environ['MAILMAN_UNDER_MASTER_CONTROL'] = '1'
+ env = {'MAILMAN_UNDER_MASTER_CONTROL': '1'}
# Craft the command line arguments for the exec() call.
rswitch = '--runner=' + spec
# Wherever master lives, so too must live the runner script.
@@ -361,14 +361,21 @@ class Loop:
# config.PYTHON, which is the absolute path to the Python interpreter,
# must be given as argv[0] due to Python's library search algorithm.
args = [sys.executable, sys.executable, exe, rswitch]
- if self._config_file is not None:
- args.extend(['-C', self._config_file])
+ # Always pass the explicit path to the configuration file to the
+ # sub-runners. This avoids any debate about which cfg file is used.
+ config_file = (config.filename if self._config_file is None
+ else self._config_file)
+ args.extend(['-C', config_file])
log = logging.getLogger('mailman.runner')
log.debug('starting: %s', args)
+ # We must pass this environment variable through if it's set,
+ # otherwise runner processes will not have the correct VAR_DIR.
+ var_dir = os.environ.get('MAILMAN_VAR_DIR')
+ if var_dir is not None:
+ env['MAILMAN_VAR_DIR'] = var_dir
# For the testing framework, if this environment variable is set, pass
# it on to the subprocess.
coverage_env = os.environ.get('COVERAGE_PROCESS_START')
- env = dict()
if coverage_env is not None:
env['COVERAGE_PROCESS_START'] = coverage_env
args.append(env)