From 27e7d553d29e5a547d8164b658f5e8881b026cb2 Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Fri, 2 Jan 2015 10:19:52 -0500 Subject: Fix the passing of certain essential environment variables down from the `mailman` foreground command, through the `master` command and to the `runner` command. Specifically, to ensure that all agree on $VAR_DIR, we ahve to set MAILMAN_VAR_DIR in the environment that `runner` gets. Also, so that all agree on the same configuration, always pass -C pointing explicitly to the cfg file that the `mailman` command sees. --- src/mailman/commands/cli_control.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/mailman/commands/cli_control.py') diff --git a/src/mailman/commands/cli_control.py b/src/mailman/commands/cli_control.py index 2febe08e5..de3542106 100644 --- a/src/mailman/commands/cli_control.py +++ b/src/mailman/commands/cli_control.py @@ -120,8 +120,8 @@ class Start: # subprocesses to calculate their path to the $VAR_DIR. Before we # chdir() though, calculate the absolute path to the configuration # file. - config_path = (os.path.abspath(args.config) - if args.config else None) + config_path = (config.filename if args.config is None + else os.path.abspath(args.config)) os.environ['MAILMAN_VAR_DIR'] = config.VAR_DIR os.chdir(config.VAR_DIR) # Exec the master watcher. @@ -131,8 +131,9 @@ class Start: ] if args.force: execl_args.append('--force') - if config_path: - execl_args.extend(['-C', config_path]) + # Always pass the config file path to the master projects, so there's + # no confusion about which cfg is being used. + execl_args.extend(['-C', config_path]) qlog.debug('starting: %s', execl_args) os.execl(*execl_args) # We should never get here. -- cgit v1.2.3-70-g09d2