每当我启动 Amavisd 时,报告启动正常,但状态检查显示它已停止运行。
$ service amavisd start
Starting amavisd: [ OK ]
$ service amavisd status
amavisd dead but subsys locked
但 Amavisd 运行良好。报告了正确的 PID。
$ cat /var/run/amavisd/amavisd.pid
13019
$ ps aux | grep amavisd
amavis 2764 1.6 31.3 1938024 1266376 ? Ssl May28 23:30 clamd.amavisd -c /etc/clamd.d/amavisd.conf --pid /var/run/clamd.amavisd/clamd.pid
amavis 13019 3.1 3.2 393740 132492 ? Ss 18:00 0:00 /usr/sbin/amavisd (master)
amavis 13032 0.0 3.2 394964 129264 ? S 18:00 0:00 /usr/sbin/amavisd (virgin child)
amavis 13033 0.0 3.2 394964 129264 ? S 18:00 0:00 /usr/sbin/amavisd (virgin child)
邮件服务器运行良好,可以手动直接连接到 Amavisd:
$ telnet localhost 10024
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 [127.0.0.1] ESMTP amavisd-new service ready
它是端口 10024 上运行的唯一进程
netstat -tulpn |grep 10024
tcp 0 0 127.0.0.1:10024 0.0.0.0:* LISTEN 13019/amavisd (mast
tcp 0 0 ::1:10024 :::* LISTEN 13019/amavisd (mast
停止服务并清除 PID、锁定文件等不起作用。例如,以下步骤会产生与上述相同的结果。清除运行文件并重新启动也是如此。
$ service amavisd stop
Shutting down amavisd: Daemon [3046] terminated by SIGTERM
[ OK ]
$ service amavisd status
amavisd is stopped
$ rm /var/run/amavisd/*
$ rm /var/lock/subsys/amavisd
$ service amavisd start
Starting amavisd: [ OK ]
$ service amavisd status
amavisd dead but subsys locked
Amavis 的 init.d 文件包含以下内容,用于状态检查
status)
status ${prog_base}
RETVAL=$?
;;
我是否应该考虑重写此文?或者问题可能出在其他地方?
为什么它明明在运行,却以为自己死了?
而且我认为它没有报告正确的进程名称:
$ cat /var/run/amavisd/amavisd.pid
24073
$ ps -p 24073 -o comm=
/usr/sbin/amavi
Whereas other processes are reports as:
$ ps -p 3145 -o comm=
php-fpm
$ ps -p 3202 -o comm=
httpd
答案1
nikita kipriyanov 的评论指出了解决方案。
编辑 init.d 脚本来检查“amavisd (master)”进程名称。
例如,status "amavisd (master)"
而不是${prog_base}
解析为amavisd