1 最后由 takyee (2012-04-30 18:04:57) 编辑

主题: iredmail avamsid 自动结束进程(急急)

==== 提供基本信息便于分析问题并得到快速回复 ====
- iRedMail 版本:iredmail 0.7.4
- 使用的 Linux/BSD 发行版名称及版本号:freebsd 8.2 32bit
- 与您的问题相关的日志信息:(delivery temporarily suspended: connect to 127.0.0.1[127.0.0.1]:10024: Connection refused)
====

使用postqueue -p 查看所有进出队列全部投递失败,连接amavsid 10024端口失败,重新启动amavsid,不到一分钟时间,amavsid自动关闭,/var/log,没有看到了相关amavsid日志

mailllog中看到的日志:

Apr 30 17:58:51 mx amavis[1470]: (!!)TROUBLE in pre_loop_hook: db_init: BDB no dbN: __fop_file_setup:  Retry limit (100) exceeded, File exists. at (eval 101) line 327.
Apr 30 17:58:51 mx amavis[1470]: (!)_DIE: Suicide () TROUBLE in pre_loop_hook: db_init: BDB no dbN: __fop_file_setup:  Retry limit (100) exceeded, File exists. at (eval 101) line 327.

回复: iredmail avamsid 自动结束进程(急急)

执行 'amavisd debug' 命令看看哪里出了问题。

3 最后由 takyee (2012-04-30 22:56:30) 编辑

回复: iredmail avamsid 自动结束进程(急急)

ZhangHuangbin 写道:

执行 'amavisd debug' 命令看看哪里出了问题。


Apr 30 18:50:34.088 mx.domain.ltd /usr/local/sbin/amavisd[1940]: starting. /usr/local/sbin/amavisd at mx.domain.ltd amavisd-new-2.7.0 (20110701), Unicode aware
Apr 30 18:50:34.088 mx.domain.ltd /usr/local/sbin/amavisd[1940]: perl=5.012004, user=, EUID: 110 (110);  group=, EGID: 110 110 (110 110)
Apr 30 18:50:34.198 mx.domain.ltd /usr/local/sbin/amavisd[1940]: INFO: no optional modules: Unix::Getrusage
Apr 30 18:50:34.199 mx.domain.ltd /usr/local/sbin/amavisd[1940]: SpamControl: attempting to load scanner SpamAssassin, module Amavis::SpamControl::SpamAssassin
Apr 30 18:50:34.199 mx.domain.ltd /usr/local/sbin/amavisd[1940]: SpamControl: scanner SpamAssassin, module Amavis::SpamControl::SpamAssassin
Apr 30 18:50:34.665 mx.domain.ltd /usr/local/sbin/amavisd[1940]: INFO: SA version: 3.3.2, 3.003002, no optional modules: Net::CIDR::Lite Sys::Hostname::Long Image::Info Image::Info::GIF Image::Info::JPEG Image::Info::PNG Image::Info::BMP Image::Info::TIFF auto::NetAddr::IP::full6 auto::NetAddr::IP::Util::inet_n2dx auto::NetAddr::IP::Util::inet_n2ad auto::NetAddr::IP::Util::inet_any2n auto::NetAddr::IP::Util::ipv6_aton
Apr 30 18:50:34.666 mx.domain.ltd /usr/local/sbin/amavisd[1940]: SpamControl: init_pre_chroot on SpamAssassin done
Apr 30 18:50:34.666 mx.domain.ltd /usr/local/sbin/amavisd[1940]: bind to /var/amavis/amavisd.sock|unix, 127.0.0.1:10024/tcp, 127.0.0.1:9998/tcp
Pid_file "/var/amavis/amavisd.pid" already exists.  Overwriting!
Apr 30 18:50:34.667 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Net::Server: 2012/04/30-18:50:34 Amavis (type Net::Server::PreForkSimple) starting! pid(1940)
Apr 30 18:50:34.673 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Net::Server: Using default listen value of 128
Apr 30 18:50:34.673 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Net::Server: Binding to UNIX socket file /var/amavis/amavisd.sock using SOCK_STREAM
Apr 30 18:50:34.674 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Net::Server: Binding to TCP port 10024 on host 127.0.0.1
Apr 30 18:50:34.674 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Net::Server: Binding to TCP port 9998 on host 127.0.0.1
Apr 30 18:50:34.674 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Net::Server: Group Not Defined.  Defaulting to EGID '110 110'
Apr 30 18:50:34.675 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Net::Server: User Not Defined.  Defaulting to EUID '110'
Apr 30 18:50:34.675 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Net::Server: Setting up serialization via flock
Apr 30 18:50:34.676 mx.domain.ltd /usr/local/sbin/amavisd[1940]: after_chroot_init: EUID: 110 (110);  EGID: 110 110 (110 110)
Apr 30 18:50:34.676 mx.domain.ltd /usr/local/sbin/amavisd[1940]: config files read: /usr/local/etc/amavisd.conf
Apr 30 18:50:34.699 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Module Amavis::Conf        2.301
Apr 30 18:50:34.700 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Module Archive::Zip        1.30
Apr 30 18:50:34.700 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Module Authen::SASL        2.15
Apr 30 18:50:34.700 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Module BerkeleyDB          0.50
Apr 30 18:50:34.700 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Module Compress::Zlib      2.024
Apr 30 18:50:34.700 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Module Convert::TNEF       0.17
Apr 30 18:50:34.700 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Module Convert::UUlib      1.4
Apr 30 18:50:34.701 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Module Crypt::OpenSSL::RSA 0.28
Apr 30 18:50:34.701 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Module DBD::mysql          4.019
Apr 30 18:50:34.701 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Module DBI                 1.618
Apr 30 18:50:34.701 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Module DB_File             1.82
Apr 30 18:50:34.701 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Module Digest::MD5         2.39
Apr 30 18:50:34.701 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Module Digest::SHA         5.47
Apr 30 18:50:34.701 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Module Digest::SHA1        2.13
Apr 30 18:50:34.702 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Module File::Temp          0.22
Apr 30 18:50:34.702 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Module IO::Socket::INET6   2.69
Apr 30 18:50:34.702 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Module MIME::Entity        5.502
Apr 30 18:50:34.702 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Module MIME::Parser        5.502
Apr 30 18:50:34.703 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Module MIME::Tools         5.502
Apr 30 18:50:34.703 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Module Mail::DKIM::Signer  0.39
Apr 30 18:50:34.703 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Module Mail::DKIM::Verifier 0.39
Apr 30 18:50:34.703 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Module Mail::Header        2.09
Apr 30 18:50:34.703 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Module Mail::Internet      2.09
Apr 30 18:50:34.703 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Module Mail::SPF           v2.007
Apr 30 18:50:34.704 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Module Mail::SpamAssassin  3.003002
Apr 30 18:50:34.704 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Module Net::DNS            0.68
Apr 30 18:50:34.705 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Module Net::LDAP           0.44
Apr 30 18:50:34.705 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Module Net::Server         0.99
Apr 30 18:50:34.705 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Module NetAddr::IP         4.058
Apr 30 18:50:34.705 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Module Razor2::Client::Version 2.84
Apr 30 18:50:34.706 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Module Socket6             0.23
Apr 30 18:50:34.706 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Module Time::HiRes         1.9719
Apr 30 18:50:34.706 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Module URI                 1.59
Apr 30 18:50:34.706 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Module Unix::Syslog        1.1
Apr 30 18:50:34.707 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Amavis::DB code      loaded
Apr 30 18:50:34.707 mx.domain.ltd /usr/local/sbin/amavisd[1940]: SQL base code        loaded
Apr 30 18:50:34.707 mx.domain.ltd /usr/local/sbin/amavisd[1940]: SQL::Log code        loaded
Apr 30 18:50:34.707 mx.domain.ltd /usr/local/sbin/amavisd[1940]: SQL::Quarantine      NOT loaded
Apr 30 18:50:34.707 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Lookup::SQL code     NOT loaded
Apr 30 18:50:34.707 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Lookup::LDAP code    loaded
Apr 30 18:50:34.707 mx.domain.ltd /usr/local/sbin/amavisd[1940]: AM.PDP-in proto code loaded
Apr 30 18:50:34.707 mx.domain.ltd /usr/local/sbin/amavisd[1940]: SMTP-in proto code   loaded
Apr 30 18:50:34.707 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Courier proto code   NOT loaded
Apr 30 18:50:34.707 mx.domain.ltd /usr/local/sbin/amavisd[1940]: SMTP-out proto code  loaded
Apr 30 18:50:34.707 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Pipe-out proto code  NOT loaded
Apr 30 18:50:34.708 mx.domain.ltd /usr/local/sbin/amavisd[1940]: BSMTP-out proto code NOT loaded
Apr 30 18:50:34.708 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Local-out proto code loaded
Apr 30 18:50:34.708 mx.domain.ltd /usr/local/sbin/amavisd[1940]: OS_Fingerprint code  NOT loaded
Apr 30 18:50:34.708 mx.domain.ltd /usr/local/sbin/amavisd[1940]: ANTI-VIRUS code      loaded
Apr 30 18:50:34.708 mx.domain.ltd /usr/local/sbin/amavisd[1940]: ANTI-SPAM code       loaded
Apr 30 18:50:34.708 mx.domain.ltd /usr/local/sbin/amavisd[1940]: ANTI-SPAM-EXT code   NOT loaded
Apr 30 18:50:34.708 mx.domain.ltd /usr/local/sbin/amavisd[1940]: ANTI-SPAM-C code     NOT loaded
Apr 30 18:50:34.708 mx.domain.ltd /usr/local/sbin/amavisd[1940]: ANTI-SPAM-SA code    loaded
Apr 30 18:50:34.708 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Unpackers code       loaded
Apr 30 18:50:34.708 mx.domain.ltd /usr/local/sbin/amavisd[1940]: DKIM code            loaded
Apr 30 18:50:34.708 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Tools code           NOT loaded
Apr 30 18:50:34.709 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Found $file            at /usr/local/bin/file
Apr 30 18:50:34.709 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Found $altermime       at /usr/local/bin/altermime
Apr 30 18:50:34.709 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Internal decoder for .mail
Apr 30 18:50:34.709 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Found decoder for    .F    at /usr/local/bin/unfreeze
Apr 30 18:50:34.710 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Found decoder for    .Z    at /usr/bin/uncompress
Apr 30 18:50:34.710 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Found decoder for    .gz   at /usr/bin/gzip -d
Apr 30 18:50:34.710 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Internal decoder for .gz   (backup, not used)
Apr 30 18:50:34.710 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Found decoder for    .bz2  at /usr/bin/bzip2 -d
Apr 30 18:50:34.711 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Found decoder for    .xz   at /usr/bin/unxz -c
Apr 30 18:50:34.712 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Found decoder for    .lzma at /usr/bin/xz -dc --format=lzma
Apr 30 18:50:34.712 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Found decoder for    .lzo  at /usr/local/bin/lzop -d
Apr 30 18:50:34.712 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Found decoder for    .rpm  at /usr/local/bin/rpm2cpio.pl
Apr 30 18:50:34.712 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Found decoder for    .cpio at /bin/pax
Apr 30 18:50:34.713 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Found decoder for    .tar  at /bin/pax
Apr 30 18:50:34.713 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Found decoder for    .deb  at /usr/bin/ar
Apr 30 18:50:34.713 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Internal decoder for .zip
Apr 30 18:50:34.713 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Found decoder for    .7z   at /usr/local/bin/7zr
Apr 30 18:50:34.714 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Found decoder for    .rar  at /usr/local/bin/unrar
Apr 30 18:50:34.714 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Found decoder for    .arj  at /usr/local/bin/arj
Apr 30 18:50:34.714 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Found decoder for    .arc  at /usr/local/bin/nomarch
Apr 30 18:50:34.714 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Found decoder for    .zoo  at /usr/local/bin/zoo
Apr 30 18:50:34.715 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Found decoder for    .lha  at /usr/local/bin/lha
Apr 30 18:50:34.715 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Found decoder for    .cab  at /usr/local/bin/cabextract
Apr 30 18:50:34.715 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Found decoder for    .tnef at /usr/local/bin/tnef
Apr 30 18:50:34.715 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Internal decoder for .tnef (backup, not used)
Apr 30 18:50:34.716 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Found decoder for    .exe  at /usr/local/bin/unrar; /usr/local/bin/lha; /usr/local/bin/arj
Apr 30 18:50:34.716 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Using primary internal av scanner code for ClamAV-clamd
Apr 30 18:50:34.716 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Found secondary av scanner ClamAV-clamscan at /usr/local/bin/clamscan
Apr 30 18:50:34.716 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Using internal spam scanner code for SpamAssassin
Apr 30 18:50:34.717 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Deleting db files __db.001,__db.002,__db.003,__db.004,snmp.db in /var/amavis/db
Apr 30 18:50:34.719 mx.domain.ltd /usr/local/sbin/amavisd[1940]: Creating db in /var/amavis/db/; BerkeleyDB 0.50, libdb 4.6
Apr 30 18:52:14.853 mx.domain.ltd /usr/local/sbin/amavisd[1940]: (!!)TROUBLE in pre_loop_hook: db_init: BDB no dbN: __fop_file_setup:  Retry limit (100) exceeded, File exists. at (eval 101) line 327.
Suicide () TROUBLE in pre_loop_hook: db_init: BDB no dbN: __fop_file_setup:  Retry limit (100) exceeded, File exists. at (eval 101) line 327.

回复: iredmail avamsid 自动结束进程(急急)

takyee 写道:

Suicide () TROUBLE in pre_loop_hook: db_init: BDB no dbN: __fop_file_setup:  Retry limit (100) exceeded, File exists. at (eval 101) line 327.

检查一下 amavisd.conf 里的 @storage_sql_dsn 和 @lookup_sql_dsn,看看是否漏了什么参数。

5 最后由 takyee (2012-04-30 23:26:26) 编辑

回复: iredmail avamsid 自动结束进程(急急)

ZhangHuangbin 写道:
takyee 写道:

Suicide () TROUBLE in pre_loop_hook: db_init: BDB no dbN: __fop_file_setup:  Retry limit (100) exceeded, File exists. at (eval 101) line 327.

检查一下 amavisd.conf 里的 @storage_sql_dsn 和 @lookup_sql_dsn,看看是否漏了什么参数。

@storage_sql_dsn = (
    ['DBI:mysql:database=amavisd;host=127.0.0.1;port=3306', 'amavisd', 'XXXXXXXXXXXXXXXXXXX'],
);
#@lookup_sql_dsn = @storage_sql_dsn;

1;  # insure a defined return

我用上面配置的用户名和密码是可以登陆到MYSQL,并且可以查看相关的表,事情原来是一次意外断电后就出现了这种问题。。。麻烦张百忙中抽出点时间帮我看看,谢谢!!

回复: iredmail avamsid 自动结束进程(急急)

可能是断电导致 Amavisd 自己建立的基于 Berkeley DB 的数据库出错了。解决方法是:

1)停止 amavisd 服务。
2)备份整个 /var/amavis/db/ 目录。
3)删除 /var/amavis/db/ 目录下的所有文件。
4)启动 Amavisd 服务。它会自动在 /var/amavis/db/ 下新建所需的文件。

如果仍然不行,记得先将原先悲愤的 /var/amavis/db/ 目录恢复回去,之后再尝试其它方法。

回复: iredmail avamsid 自动结束进程(急急)

ZhangHuangbin 写道:

可能是断电导致 Amavisd 自己建立的基于 Berkeley DB 的数据库出错了。解决方法是:

1)停止 amavisd 服务。
2)备份整个 /var/amavis/db/ 目录。
3)删除 /var/amavis/db/ 目录下的所有文件。
4)启动 Amavisd 服务。它会自动在 /var/amavis/db/ 下新建所需的文件。

如果仍然不行,记得先将原先悲愤的 /var/amavis/db/ 目录恢复回去,之后再尝试其它方法。

问题解决了,果然是意外断电造成的Amavisd 自己建立的基于 Berkeley DB 的数据库出错了。张工的解决方案非常行之有效。

对张工的帮助我有说不尽的感谢话。他帮助了我在应用中解决的众多问题。感谢iredmail的全体员工,感谢他们辛勤付出。

回复: iredmail avamsid 自动结束进程(急急)

Enjoy. smile