1=================== 2Getting information 3=================== 4 5You can get information about Mailman's environment by using the command line 6script ``mailman info``. By default, the info is printed to standard output. 7:: 8 9 >>> command = cli('mailman.commands.cli_info.info') 10 11 >>> command('mailman info') 12 GNU Mailman 3... 13 Python ... 14 ... 15 config file: .../test.cfg 16 db url: ... 17 REST root url: http://localhost:9001/3.1/ 18 REST credentials: restadmin:restpass 19 20By passing in the ``-o/--output`` option, you can print the info to a file. 21 22 >>> from mailman.config import config 23 >>> import os 24 >>> output_path = os.path.join(config.VAR_DIR, 'output.txt') 25 >>> command('mailman info -o ' + output_path) 26 >>> with open(output_path) as fp: 27 ... print(fp.read()) 28 GNU Mailman 3... 29 Python ... 30 ... 31 config file: .../test.cfg 32 db url: ... 33 devmode: DISABLED 34 REST root url: http://localhost:9001/3.1/ 35 REST credentials: restadmin:restpass 36 37You can also get more verbose information, which contains a list of the file 38system paths that Mailman is using. 39 40 >>> config.create_paths = False 41 >>> config.push('fhs', """ 42 ... [mailman] 43 ... layout: fhs 44 ... """) 45 >>> ignore = cleanups.callback(config.pop, 'fhs') 46 >>> config.create_paths = True 47 48The `Filesystem Hierarchy Standard`_ layout is the same everywhere by 49definition. 50 51 >>> command('mailman info --verbose') 52 GNU Mailman 3... 53 Python ... 54 ... 55 File system paths: 56 ARCHIVE_DIR = /var/lib/mailman/archives 57 BIN_DIR = /sbin 58 CACHE_DIR = /var/lib/mailman/cache 59 CFG_FILE = .../test.cfg 60 DATA_DIR = /var/lib/mailman/data 61 ETC_DIR = /etc 62 LIST_DATA_DIR = /var/lib/mailman/lists 63 LOCK_DIR = /var/lock/mailman 64 LOCK_FILE = /var/lock/mailman/master.lck 65 LOG_DIR = /var/log/mailman 66 MESSAGES_DIR = /var/lib/mailman/messages 67 PID_FILE = /var/run/mailman/master.pid 68 QUEUE_DIR = /var/spool/mailman 69 TEMPLATE_DIR = .../mailman/templates 70 VAR_DIR = /var/lib/mailman 71 72 73.. _`Filesystem Hierarchy Standard`: http://www.pathname.com/fhs/ 74