summaryrefslogtreecommitdiff
path: root/src/mailman/commands/docs/info.rst
blob: 5cea9ee2c4168ff8d27c73ce3ab297bb84a1b6e8 (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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
===================
Getting information
===================

You can get information about Mailman's environment by using the command line
script ``mailman info``.  By default, the info is printed to standard output.
::

    >>> from mailman.commands.cli_info import Info
    >>> command = Info()

    >>> class FakeArgs:
    ...     output = None
    ...     verbose = None
    >>> args = FakeArgs()

    >>> command.process(args)
    GNU Mailman 3...
    Python ...
    ...
    config file: .../test.cfg
    db url: ...
    REST root url: http://localhost:9001/3.1/
    REST credentials: restadmin:restpass

By passing in the ``-o/--output`` option, you can print the info to a file.

    >>> from mailman.config import config
    >>> import os
    >>> output_path = os.path.join(config.VAR_DIR, 'output.txt')
    >>> args.output = output_path
    >>> command.process(args)
    >>> with open(output_path) as fp:
    ...     print(fp.read())
    GNU Mailman 3...
    Python ...
    ...
    config file: .../test.cfg
    db url: ...
    devmode: DISABLED
    REST root url: http://localhost:9001/3.1/
    REST credentials: restadmin:restpass

You can also get more verbose information, which contains a list of the file
system paths that Mailman is using.

    >>> args.output = None
    >>> args.verbose = True
    >>> config.create_paths = False
    >>> config.push('fhs', """
    ... [mailman]
    ... layout: fhs
    ... """)
    >>> cleanups.append((config.pop, 'fhs'))
    >>> config.create_paths = True

The `Filesystem Hierarchy Standard`_ layout is the same everywhere by
definition.

    >>> command.process(args)
    GNU Mailman 3...
    Python ...
    ...
    File system paths:
        ARCHIVE_DIR     = /var/lib/mailman/archives
        BIN_DIR         = /sbin
        CACHE_DIR       = /var/lib/mailman/cache
        CFG_FILE        = .../test.cfg
        DATA_DIR        = /var/lib/mailman/data
        ETC_DIR         = /etc
        EXT_DIR         = /etc/mailman.d
        LIST_DATA_DIR   = /var/lib/mailman/lists
        LOCK_DIR        = /var/lock/mailman
        LOCK_FILE       = /var/lock/mailman/master.lck
        LOG_DIR         = /var/log/mailman
        MESSAGES_DIR    = /var/lib/mailman/messages
        PID_FILE        = /var/run/mailman/master.pid
        QUEUE_DIR       = /var/spool/mailman
        TEMPLATE_DIR    = .../mailman/templates
        VAR_DIR         = /var/lib/mailman


.. _`Filesystem Hierarchy Standard`: http://www.pathname.com/fhs/