Whenever I start Amavisd, the reports starting OK, but a status check says it's dead.
$ service amavisd start
Starting amavisd: [ OK ]
$ service amavisd status
amavisd dead but subsys locked
But Amavisd is running just fine. Correct PID reported.
$ 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)
Mail server is running fine, and can connect directly to Amavisd manually:
$ telnet localhost 10024
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 [127.0.0.1] ESMTP amavisd-new service ready
It is the only process running on port 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
Stopping the service and clearing the PIDs, lock files, etc. doesn't do the trick. eg. following steps results in the same results as above. Same with clearing the run files and rebooting.
$ 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
The init.d file for Amavis has the following for a status check
status)
status ${prog_base}
RETVAL=$?
;;
Should I be looking at rewriting this? or may the problem lay elsewhere?
Why does it think it is dead when it is clearly running?
and I think it's not reporting the correct process name:
$ 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