summaryrefslogtreecommitdiff
path: root/src/mailman/commands/cli_control.py
diff options
context:
space:
mode:
authorBarry Warsaw2015-01-04 20:20:33 -0500
committerBarry Warsaw2015-01-04 20:20:33 -0500
commit4a612db8e89afed74173b93f3b64fa567b8417a3 (patch)
tree81a687d113079a25f93279f35c7eee2aa2572510 /src/mailman/commands/cli_control.py
parent84af79988a4e916604cba31843778206efb7d1b8 (diff)
parentde181c1a40965a3a7deedd56a034a946f45b6984 (diff)
downloadmailman-4a612db8e89afed74173b93f3b64fa567b8417a3.tar.gz
mailman-4a612db8e89afed74173b93f3b64fa567b8417a3.tar.zst
mailman-4a612db8e89afed74173b93f3b64fa567b8417a3.zip
Diffstat (limited to 'src/mailman/commands/cli_control.py')
-rw-r--r--src/mailman/commands/cli_control.py17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/mailman/commands/cli_control.py b/src/mailman/commands/cli_control.py
index b0afc1337..de3542106 100644
--- a/src/mailman/commands/cli_control.py
+++ b/src/mailman/commands/cli_control.py
@@ -15,11 +15,8 @@
# You should have received a copy of the GNU General Public License along with
# GNU Mailman. If not, see <http://www.gnu.org/licenses/>.
-"""Module stuff."""
+"""Start/stop/reopen/restart commands."""
-from __future__ import absolute_import, print_function, unicode_literals
-
-__metaclass__ = type
__all__ = [
'Reopen',
'Restart',
@@ -34,12 +31,11 @@ import errno
import signal
import logging
-from zope.interface import implementer
-
from mailman.bin.master import WatcherState, master_state
from mailman.config import config
from mailman.core.i18n import _
from mailman.interfaces.command import ICLISubCommand
+from zope.interface import implementer
qlog = logging.getLogger('mailman.runner')
@@ -124,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.
@@ -135,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.