diff options
| author | Barry Warsaw | 2009-10-06 23:37:40 -0400 |
|---|---|---|
| committer | Barry Warsaw | 2009-10-06 23:37:40 -0400 |
| commit | 504e5d7d8bc9710dd28a18dcb03380ee7183483c (patch) | |
| tree | f07585a94abf79cdef39a49e5d31e3ccbf073ca3 /src/mailman/commands/cli_control.py | |
| parent | eafec352555fae996be5fbb4d1992df9641a3aa6 (diff) | |
| download | mailman-504e5d7d8bc9710dd28a18dcb03380ee7183483c.tar.gz mailman-504e5d7d8bc9710dd28a18dcb03380ee7183483c.tar.zst mailman-504e5d7d8bc9710dd28a18dcb03380ee7183483c.zip | |
Diffstat (limited to 'src/mailman/commands/cli_control.py')
| -rw-r--r-- | src/mailman/commands/cli_control.py | 46 |
1 files changed, 37 insertions, 9 deletions
diff --git a/src/mailman/commands/cli_control.py b/src/mailman/commands/cli_control.py index 919ebc0be..cab3d0fd9 100644 --- a/src/mailman/commands/cli_control.py +++ b/src/mailman/commands/cli_control.py @@ -21,6 +21,8 @@ from __future__ import absolute_import, unicode_literals __metaclass__ = type __all__ = [ + 'Reopen', + 'Restart', 'Start', 'Stop', ] @@ -144,12 +146,14 @@ def kill_watcher(sig): -class Stop: - """Stop the Mailman daemons.""" - +class SignalCommand: + """Common base class for simple, signal sending commands.""" + implements(ICLISubCommand) - name = 'stop' + name = None + message = None + signal = None def add(self, parser, command_parser): """See `ICLISubCommand`.""" @@ -162,8 +166,32 @@ class Stop: def process(self, args): """See `ICLISubCommand`.""" - def log(message): - if not args.quiet: - print message - log(_("Shutting down Mailman's master qrunner")) - kill_watcher(signal.SIGTERM) + if not args.quiet: + print _(self.message) + kill_watcher(self.signal) + + +class Stop(SignalCommand): + """Stop the Malman daemons.""" + + name = 'stop' + message = _("Shutting down Mailman's master qrunner") + signal = signal.SIGTERM + + +class Reopen(SignalCommand): + """Reopen the Mailman daemons.""" + + name = 'reopen' + message = _('Reopening the Mailman qrunners') + signal = signal.SIGHUP + + +class Restart(SignalCommand): + """Stop the Mailman daemons.""" + + implements(ICLISubCommand) + + name = 'restart' + message = _('Restarting the Mailman qrunners') + signal = signal.SIGUSR1 |
