amavis
升级到 FreeBSD 12 后,我时不时会遇到一些问题。
目前事故原因尚不清楚。
一个简单的方法kill -9 $amavispid && service amavids start
就可以奏效,但几个小时后一切又要重新开始。
这是崩溃时的日志输出:
Dec 19 02:51:14 mailserver postfix/pickup[9697]: 75223B166: uid=58 from=<MAILER-DAEMON>
Dec 19 02:51:14 mailserver postfix/pipe[17647]: 7A3F1B162: to=<[email protected]>, relay=spamassassin, delay=1.1, delays=0.44/0/0/0.68, dsn=2.0.0, status=sent (delivered via spamassassin service)
Dec 19 02:51:14 mailserver postfix/qmgr[850]: 7A3F1B162: removed
Dec 19 02:51:14 mailserver postfix/cleanup[17644]: 75223B166: message-id=<[email protected]>
Dec 19 02:51:14 mailserver postfix/qmgr[850]: 75223B166: from=<>, size=7592, nrcpt=1 (queue active)
Dec 19 02:51:14 mailserver spamd[758]: prefork: child states: II
Dec 19 02:51:15 mailserver amavis[772]: (00772-07) (!!)TROUBLE in check_mail: decide_mail_destiny FAILED: register_proc: BDB N c_get: BDB0061 PANIC: Invalid argument, No such process. at (eval 93) line 222.
Dec 19 02:51:15 mailserver amavis[772]: (00772-07) (!!)TROUBLE in process_request: register_proc: BDB N db_cursor: BDB0060 PANIC: fatal region error detected; run recovery, . at (eval 93) line 220.
Dec 19 02:51:15 mailserver amavis[772]: (00772-07) (!)Requesting process rundown after fatal error
Dec 19 02:51:15 mailserver amavis[772]: (00772-07) (!)TempDir removal: tempdir is to be PRESERVED: /var/amavis/tmp/amavis-20181218T235619-00772-TJFdgQp3
Dec 19 02:51:15 mailserver amavis[772]: (00772-07) (!)_DIE: register_proc: BDB N db_cursor: BDB0060 PANIC: fatal region error detected; run recovery, . at (eval 93) line 220.
Dec 19 02:51:15 mailserver postfix/lmtp[17651]: 6CB9FB164: to=<[email protected]>, relay=127.0.0.1[127.0.0.1]:10024, delay=0.87, delays=0.01/0.01/0/0.85, dsn=4.3.2, status=deferred (host 127.0.0.1[127.0.0.1] said: 421 4.3.2 Service shutting down, closing channel (in reply to end of DATA command))
Dec 19 02:51:15 mailserver amavis[772]: (00772-07) (!)Amavis::END: DB unregistering failed:
Dec 19 02:51:15 mailserver amavis[17658]: (!!)TROUBLE in child_init_hook: BDB can't connect db env. at /var/amavis/db: BDB0087 DB_RUNRECOVERY: Fatal error, run database recovery, No such file or directory. at (eval 93) line 338.
Dec 19 02:51:15 mailserver amavis[17658]: (!)_DIE: Suicide in child_init_hook: BDB can't connect db env. at /var/amavis/db: BDB0087 DB_RUNRECOVERY: Fatal error, run database recovery, No such file or directory. at (eval 93) line 338.
Dec 19 02:51:15 mailserver amavis[17659]: (!!)TROUBLE in child_init_hook: BDB can't connect db env. at /var/amavis/db: BDB0087 DB_RUNRECOVERY: Fatal error, run database recovery, No such file or directory. at (eval 93) line 338.
Dec 19 02:51:15 mailserver amavis[17659]: (!)_DIE: Suicide in child_init_hook: BDB can't connect db env. at /var/amavis/db: BDB0087 DB_RUNRECOVERY: Fatal error, run database recovery, No such file or directory. at (eval 93) line 338.
Dec 19 02:51:15 mailserver amavis[17660]: (!!)TROUBLE in child_init_hook: BDB can't connect db env. at /var/amavis/db: BDB0087 DB_RUNRECOVERY: Fatal error, run database recovery, No such file or directory. at (eval 93) line 338.
Dec 19 02:51:15 mailserver amavis[17660]: (!)_DIE: Suicide in child_init_hook: BDB can't connect db env. at /var/amavis/db: BDB0087 DB_RUNRECOVERY: Fatal error, run database recovery, No such file or directory. at (eval 93) line 338.
Dec 19 02:51:15 mailserver amavis[17661]: (!!)TROUBLE in child_init_hook: BDB can't connect db env. at /var/amavis/db: BDB0087 DB_RUNRECOVERY: Fatal error, run database recovery, No such file or directory. at (eval 93) line 338.
Dec 19 02:51:15 mailserver amavis[17661]: (!)_DIE: Suicide in child_init_hook: BDB can't connect db env. at /var/amavis/db: BDB0087 DB_RUNRECOVERY: Fatal error, run database recovery, No such file or directory. at (eval 93) line 338.
Dec 19 02:51:15 mailserver amavis[17662]: (!!)TROUBLE in child_init_hook: BDB can't connect db env. at /var/amavis/db: BDB0087 DB_RUNRECOVERY: Fatal error, run database recovery, No such file or directory. at (eval 93) line 338.
Dec 19 02:51:15 mailserver amavis[17662]: (!)_DIE: Suicide in child_init_hook: BDB can't connect db env. at /var/amavis/db: BDB0087 DB_RUNRECOVERY: Fatal error, run database recovery, No such file or directory. at (eval 93) line 338.
最后几行继续,直到我终止服务并将日志文件发送到垃圾邮件。
再次,我重新启动服务后一切都恢复正常。系统资源没有耗尽。CPU 负载为 0.5,内存充足(~20%),磁盘未被填满。
我不知道在哪里搜索...
PS:主机名和域名当然会改变
编辑:如果其他人也遇到这个问题,我找到了一个解决方法。您可能只是禁用 Berkley 数据库功能,该功能会通过以下方式缓存某些结果:$enable_db = 0;
这不是解决方案,而是一种解决方法!