summaryrefslogtreecommitdiff
path: root/src/mailman/commands/docs/control.rst
blob: 446c3652f2fd9ccac82f6ec6484641377cb1569f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
=============================
Starting and stopping Mailman
=============================

The Mailman daemon processes can be started and stopped from the command
line.


Set up
======

All we care about is the master process; normally it starts a bunch of
runners, but we don't care about any of them, so write a test configuration
file for the master that disables all the runners.

    >>> from mailman.commands.tests.test_cli_control import make_config
    >>> make_config(cleanups)


Starting
========

    >>> command = cli('mailman.commands.cli_control.start')

Starting the daemons prints a useful message and starts the master watcher
process in the background.

    >>> command('mailman start')
    Starting Mailman's master runner

    >>> from mailman.commands.tests.test_cli_control import find_master

The process exists, and its pid is available in a run time file.

    >>> pid = find_master()
    >>> pid is not None
    True


Stopping
========

You can also stop the master watcher process from the command line, which
stops all the child processes too.
::

    >>> command = cli('mailman.commands.cli_control.stop')
    >>> command('mailman stop')
    Shutting down Mailman's master runner

..
    # Clean up.
    >>> from mailman.commands.tests.test_cli_control import (
    ...     kill_with_extreme_prejudice)
    >>> kill_with_extreme_prejudice(pid)