我看到过一些解决此问题的建议,包括SE 上有一个。
mailman 2.1 现在是否需要以与 Apache 相同的用户身份运行?在我们的例子中,httpd
以用户“ apache
”运行,mailman 以“ ”运行。我重新安装了 mailman,没有任何区别。我多次看到这个错误,并按照我所做的那样mailman
运行。check_perms
/usr/lib/mailman/bin/check_perms
/usr/lib/mailman/bin/mailman-update-cfg bad group (has: root, expected mailman)
Problems found: 1
Re-run as mailman (or root) with -f flag to fix
ls -l /usr/lib/mailman/bin/mailman-update-cfg
-rwxr-xr-x 1 root root 436 Feb 12 06:54 /usr/lib/mailman/bin/mailman-update-cfg
chown mailman:mailman /usr/lib/mailman/bin/mailman-update-cfg
/usr/lib/mailman/bin/check_perms
No problems found
systemctl status mailman
● mailman.service - GNU Mailing List Manager
Loaded: loaded (/usr/lib/systemd/system/mailman.service; enabled; vendor preset: disabled)
Active: active (running) since Thu 2019-07-18 16:18:41 EDT; 3 days ago
Main PID: 20380 (mailmanctl)
Tasks: 9 (limit: 4915)
Memory: 131.2M
CGroup: /system.slice/mailman.service
├─20380 /usr/bin/python2 /usr/lib/mailman/bin/mailmanctl -s start
├─20381 /usr/bin/python2 /usr/lib/mailman/bin/qrunner --runner=ArchRunner:0:1 -s
├─20382 /usr/bin/python2 /usr/lib/mailman/bin/qrunner --runner=BounceRunner:0:1 -s
├─20383 /usr/bin/python2 /usr/lib/mailman/bin/qrunner --runner=CommandRunner:0:1 -s
├─20384 /usr/bin/python2 /usr/lib/mailman/bin/qrunner --runner=IncomingRunner:0:1 -s
├─20385 /usr/bin/python2 /usr/lib/mailman/bin/qrunner --runner=NewsRunner:0:1 -s
├─20386 /usr/bin/python2 /usr/lib/mailman/bin/qrunner --runner=OutgoingRunner:0:1 -s
├─20387 /usr/bin/python2 /usr/lib/mailman/bin/qrunner --runner=VirginRunner:0:1 -s
└─20388 /usr/bin/python2 /usr/lib/mailman/bin/qrunner --runner=RetryRunner:0:1 -s
Jul 18 16:18:41 ourhost.edu systemd[1]: Starting GNU Mailing List Manager...
Jul 18 16:18:41 ourhost.edu mailmanctl[20379]: Starting Mailman's master qrunner.
Jul 18 16:18:41 ourhost.edu systemd[1]: Started GNU Mailing List Manager.
ls -l /var/lib/mailman/lists/book/
total 24
-rw-rw---- 1 mailman mailman 5593 Jul 22 09:00 config.pck
-rw-rw---- 1 mailman mailman 5593 Jul 21 12:00 config.pck.last
-rw-rw---- 1 mailman mailman 131 Oct 12 2018 pending.pck
-rw-rw---- 1 apache mailman 20 Oct 13 2018 request.pck
重新安装后,实际日志文件被指出存在权限问题:
ls -l /var/log/mailman/error
-rw-rw---- 1 mailman mailman 37997 Jul 22 10:57 /var/log/mailman/error
[----- Mailman Version: 2.1.29 -----]
[----- Traceback ------]
Traceback (most recent call last):
File "/usr/lib/mailman/scripts/driver", line 85, in run_main
immediate=1)
File "/usr/lib/mailman/Mailman/Logging/StampedLogger.py", line 52, in __init__
Logger.__init__(self, category, nofail, immediate)
File "/usr/lib/mailman/Mailman/Logging/Logger.py", line 50, in __init__
self.__get_f()
File "/usr/lib/mailman/Mailman/Logging/Logger.py", line 68, in __get_f
1)
File "/usr/lib64/python2.7/codecs.py", line 898, in open
file = __builtin__.open(filename, mode, buffering)
IOError: [Errno 13] Permission denied: '/var/log/mailman/error'
[----- Python Information -----]
sys.version = 2.7.16 (default, Apr 30 2019, 15:54:43)
[GCC 9.0.1 20190312 (Red Hat 9.0.1-0.10)]
sys.executable = /usr/bin/python2
sys.prefix = /usr
sys.exec_prefix = /usr
sys.path = ['/usr/lib/mailman/pythonlib', '/usr/lib/mailman', '/usr/lib/mailman/scripts', '/usr/lib/mailman', '/usr/lib/python27.zip', '/usr/lib64/python2.7', '/usr/lib64/python2.7/plat-linux2', '/usr/lib64/python2.7/lib-tk', '/usr/lib64/python2.7/lib-old', '/usr/lib64/python2.7/lib-dynload', '/usr/lib/python2.7/site-packages', '/usr/lib/python2.7/dist-packages']
sys.platform = linux2
PYTHONPATH: /usr/lib/mailman
REMOTE_PORT: 60557
REQUEST_SCHEME: https
SCRIPT_NAME: /mailman/listinfo
REQUEST_METHOD: GET
SERVER_PORT: 443
SERVER_PROTOCOL: HTTP/1.1
QUERY_STRING:
REQUEST_URI: /mailman/listinfo
DOCUMENT_ROOT: /var/www/html
然后我chmod 755
到日志文件看到这个错误:
admin(24082): [----- Mailman Version: 2.1.29 -----]
admin(24082): [----- Traceback ------]
admin(24082): Traceback (most recent call last):
admin(24082): File "/usr/lib/mailman/scripts/driver", line 117, in run_main
admin(24082): main()
admin(24082): File "/usr/lib/mailman/Mailman/Cgi/listinfo.py", line 44, in main
admin(24082): listinfo_overview()
admin(24082): File "/usr/lib/mailman/Mailman/Cgi/listinfo.py", line 104, in listinfo_overview
admin(24082): mlist = MailList.MailList(name, lock=0)
admin(24082): File "/usr/lib/mailman/Mailman/MailList.py", line 133, in __init__
admin(24082): self.Load()
admin(24082): File "/usr/lib/mailman/Mailman/MailList.py", line 692, in Load
admin(24082): dict, e = self.__load(file)
admin(24082): File "/usr/lib/mailman/Mailman/MailList.py", line 655, in __load
admin(24082): fp = open(dbfile)
admin(24082): IOError: [Errno 13] Permission denied: '/var/lib/mailman/lists/book/config.pck'
admin(24082): [----- Python Information -----]
admin(24082): sys.version = 2.7.16 (default, Apr 30 2019, 15:54:43)
[GCC 9.0.1 20190312 (Red Hat 9.0.1-0.10)]
admin(24082): sys.executable = /usr/bin/python2
admin(24082): sys.prefix = /usr
根据链接的线程,我尝试运行 chown -hR mailman:mailman ./*
但/var/lib/mailman/
没有成功。
ps -elf | grep -i mailman
1 S mailman 2392 1 0 80 0 - 66788 - 14:36 ? 00:00:00 /usr/bin/python2 /usr/lib/mailman/bin/mailmanctl -s start
0 S mailman 2393 2392 0 80 0 - 59169 - 14:36 ? 00:00:00 /usr/bin/python2 /usr/lib/mailman/bin/qrunner --runner=ArchRunner:0:1 -s
0 S mailman 2394 2392 0 80 0 - 59146 - 14:36 ? 00:00:00 /usr/bin/python2 /usr/lib/mailman/bin/qrunner --runner=BounceRunner:0:1 -s
0 S mailman 2395 2392 0 80 0 - 59139 - 14:36 ? 00:00:00 /usr/bin/python2 /usr/lib/mailman/bin/qrunner --runner=CommandRunner:0:1 -s
0 S mailman 2396 2392 0 80 0 - 59146 - 14:36 ? 00:00:00 /usr/bin/python2 /usr/lib/mailman/bin/qrunner --runner=IncomingRunner:0:1 -s
0 S mailman 2397 2392 0 80 0 - 59172 - 14:36 ? 00:00:00 /usr/bin/python2 /usr/lib/mailman/bin/qrunner --runner=NewsRunner:0:1 -s
0 S mailman 2398 2392 0 80 0 - 59137 - 14:36 ? 00:00:00 /usr/bin/python2 /usr/lib/mailman/bin/qrunner --runner=OutgoingRunner:0:1 -s
0 S mailman 2399 2392 0 80 0 - 59138 - 14:36 ? 00:00:00 /usr/bin/python2 /usr/lib/mailman/bin/qrunner --runner=VirginRunner:0:1 -s
0 S mailman 2400 2392 0 80 0 - 59137 - 14:36 ? 00:00:00 /usr/bin/python2 /usr/lib/mailman/bin/qrunner --runner=RetryRunner:0:1 -s
systemctl status mailman
● mailman.service - GNU Mailing List Manager
Loaded: loaded (/usr/lib/systemd/system/mailman.service; enabled; vendor preset: disabled)
Active: active (running) since Mon 2019-07-22 14:36:23 EDT; 56min ago
Process: 2386 ExecStartPre=/usr/lib/mailman/bin/mailman-update-cfg (code=exited, status=0/SUCCESS)
Process: 2387 ExecStartPre=/usr/bin/install -m644 -o root -g root /usr/lib/mailman/cron/crontab.in /etc/cron.d/mailman (code=exited, status=0/SUCCESS)
Process: 2388 ExecStartPre=/bin/touch /var/log/mailman/error (code=exited, status=0/SUCCESS)
Process: 2389 ExecStartPre=/bin/chown mailman:mailman /var/log/mailman/error (code=exited, status=0/SUCCESS)
Process: 2390 ExecStartPre=/bin/chmod 666 /var/log/mailman/error (code=exited, status=0/SUCCESS)
Process: 2391 ExecStart=/usr/lib/mailman/bin/mailmanctl -s start (code=exited, status=0/SUCCESS)
Main PID: 2392 (mailmanctl)
Tasks: 9 (limit: 4915)
Memory: 128.7M
CGroup: /system.slice/mailman.service
├─2392 /usr/bin/python2 /usr/lib/mailman/bin/mailmanctl -s start
├─2393 /usr/bin/python2 /usr/lib/mailman/bin/qrunner --runner=ArchRunner:0:1 -s
├─2394 /usr/bin/python2 /usr/lib/mailman/bin/qrunner --runner=BounceRunner:0:1 -s
├─2395 /usr/bin/python2 /usr/lib/mailman/bin/qrunner --runner=CommandRunner:0:1 -s
├─2396 /usr/bin/python2 /usr/lib/mailman/bin/qrunner --runner=IncomingRunner:0:1 -s
├─2397 /usr/bin/python2 /usr/lib/mailman/bin/qrunner --runner=NewsRunner:0:1 -s
├─2398 /usr/bin/python2 /usr/lib/mailman/bin/qrunner --runner=OutgoingRunner:0:1 -s
├─2399 /usr/bin/python2 /usr/lib/mailman/bin/qrunner --runner=VirginRunner:0:1 -s
└─2400 /usr/bin/python2 /usr/lib/mailman/bin/qrunner --runner=RetryRunner:0:1 -s
Jul 22 14:36:22 systemd[1]: Starting GNU Mailing List Manager...
Jul 22 14:36:23 mailmanctl[2391]: Starting Mailman's master qrunner.
Jul 22 14:36:23 systemd[1]: Started GNU Mailing List Manager.
编辑:这些日志有帮助吗?
Jul 24 16:38:28 2019 admin(3609): @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
admin(3609): [----- Mailman Version: 2.1.29 -----]
admin(3609): [----- Traceback ------]
admin(3609): Traceback (most recent call last):
admin(3609): File "/usr/lib/mailman/scripts/driver", line 117, in run_main
admin(3609): main()
admin(3609): File "/usr/lib/mailman/Mailman/Cgi/admindb.py", line 345, in main
admin(3609): mlist.Save()
admin(3609): File "/usr/lib/mailman/Mailman/MailList.py", line 613, in Save
admin(3609): self.__save(dict)
admin(3609): File "/usr/lib/mailman/Mailman/MailList.py", line 590, in __save
admin(3609): os.link(fname, fname_last)
admin(3609): OSError: [Errno 1] Operation not permitted
admin(3609): [----- Python Information -----]
admin(3609): sys.version = 2.7.16 (default, Apr 30 2019, 15:54:43)
[GCC 9.0.1 20190312 (Red Hat 9.0.1-0.10)]
admin(3609): sys.executable = /usr/bin/python2
admin(3609): sys.prefix = /usr
admin(3609): sys.exec_prefix = /usr
admin(3609): sys.path = ['/usr/lib/mailman/pythonlib', '/usr/lib/mailman', '/usr/lib/mailman/scripts', '/usr/lib/mailman', '/usr/lib/python27.zip', '/usr/lib64/python2.7', '/usr/lib64/python2.7/plat-linux2', '/usr/lib64/python2.7/lib-tk', '/usr/lib64/python2.7/lib-old', '/usr/lib64/python2.7/lib-dynload', '/usr/lib/python2.7/site-packages', '/usr/lib/python2.7/dist-packages']
admin(3609): sys.platform = linux2
admin(3609): [----- Environment Variables -----]
admin(3609): CONTENT_LENGTH: 38
admin(3609): HTTPS: on
admin(3609): HTTP_COOKIE:
admin(3609): SERVER_NAME: ourdomain
admin(3609): SERVER_PROTOCOL: HTTP/1.1
admin(3609): PYTHONPATH: /usr/lib/mailman
admin(3609): REMOTE_ADDR: myip
admin(3609): REQUEST_SCHEME: https
admin(3609): SCRIPT_NAME: /mailman/admindb
admin(3609): REQUEST_METHOD: POST
admin(3609): SERVER_PORT: 443
admin(3609): HTTP_HOST: ourdomain
admin(3609): PATH_INFO: /mailman
admin(3609): CONTENT_TYPE: application/x-www-form-urlencoded
admin(3609): REMOTE_PORT: 57350
admin(3609): QUERY_STRING:
admin(3609): REQUEST_URI: /mailman/admindb/mailman
admin(3609): DOCUMENT_ROOT: /var/www/html