1

I have noticed that occasionally amavis is not running.

I thought monit was watching the process, however it doesn't seem to warn me or fix it.

My monitrc entry looks like this and I can confirm that starting/stopping the process with monit works:

check process amavisd with pidfile /var/run/amavis/amavisd.pid
     group mail
     start program = "/etc/init.d/amavis start"
     stop  program = "/etc/init.d/amavis stop"
     if failed port 10024 protocol smtp then restart
     if 5 restarts within 5 cycles then timeout
     depends on amavisd_bin
     depends on amavisd_rc

   check file amavisd_bin with path /usr/sbin/amavisd-new
     group mail
     if failed checksum then unmonitor
     if failed permission 755 then unmonitor
     if failed uid root then unmonitor
     if failed gid root then unmonitor

   check file amavisd_rc with path /etc/init.d/amavis
     group mail
     if failed checksum then unmonitor
     if failed permission 755 then unmonitor
     if failed uid root then unmonitor
     if failed gid root then unmonitor

How should I troubleshoot this?

Adripants
  • 347
  • 2
  • 5
  • 16
  • Process 'sshd' Not monitored Process 'mysql' Not monitored Process 'postfix' Not monitored Process 'amavisd' Connection failed File 'amavisd_bin' Accessible File 'amavisd_rc' Accessible Process 'clamd' Not monitored Process 'dovecot' Not monitored File 'dovecot_init' Accessible File 'dovecot_bin' Accessible – Adripants Dec 19 '13 at 01:17
  • looks like I have some work to do. – Adripants Dec 19 '13 at 01:18

2 Answers2

2

I think the correct pidfile path is /var/run/amavisd/amavisd.pid

so you are missing a 'd' in 'amavisd' directory name.

Start and Stop would work since start/stop paths are ok but pid file won't be found.

chicks
  • 3,639
  • 10
  • 26
  • 36
wizy
  • 21
  • 2
0

Start by checking that all the tests in the monit configuration is valid.

  • Does the configuration file have valid syntax?
  • Does /var/run/amavis/amavisd.pid exist?
  • Does /etc/init.d/amavis start and stop functions work?
  • Is amavis listening on port 10024 protocol SMTP?
  • Does /usr/sbin/amavisd-new and /etc/init.d/amavis exists?

Then you should continue to check the output of monit summary and monit status verbose and check if the output will help you to find the problem.

This might be a problem with monit or a problem with amavis. Or a combination of both. If you post more information (e.g. output from monit summary) I will edit this answer with more help.

pkhamre
  • 5,900
  • 3
  • 15
  • 27
  • I have checked through each of those and the answer is yes. I mentioned I can start it with monit, and monit warns me when it goes down: Connection failed Service amavisd Date: Thu, 19 Dec 2013 13:26:22 Action: restart Host: myserver.com.au Description: failed protocol test [SMTP] at INET[localhost:10024] via TCP -- SMTP: error receiving data -- Resource temporarily unavailable – Adripants Dec 19 '13 at 03:09