blob: 6d433b467b261d40f3ce83857d5c4e58330f8a1f (
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
|
==============
Getting status
==============
The status of the Mailman master process can be queried from the command line.
It's clear at this point that nothing is running.
::
>>> command = cli('mailman.commands.cli_status.status')
The status is printed to stdout and a status code is returned.
>>> command('mailman status')
GNU Mailman is not running
We can simulate the master starting up by acquiring its lock.
>>> from datetime import timedelta
>>> from flufl.lock import Lock
>>> lock = Lock(config.LOCK_FILE)
>>> lock.lock(timeout=timedelta(seconds=20))
>>> ignore = cleanups.callback(lock.unlock, unconditionally=True)
Getting the status confirms that the master is running.
>>> command('mailman status')
GNU Mailman is running (master pid: ...
We shut down the master and confirm the status.
>>> lock.unlock(unconditionally=True)
>>> command('mailman status')
GNU Mailman is not running
|