monit-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: clamav-milter always detected not running


From: Jan-Henrik Haukeland
Subject: Re: clamav-milter always detected not running
Date: Sat, 19 Nov 2005 19:02:54 +0100


On 19. nov. 2005, at 14.54, afraz wrote:

'clamav-milter' process is not running
Does not exist notification is sent to root@<my local domain>
'clamav-milter' trying to restart

No light bubble was turned on over my head. Anyone else get clamav to run with monit?
Anyway, here is a couple of other things to try.

1) Remove the dependencies and only test the clamav entry

check process clamav-milter with pidfile /var/run/clamav/clamav- milter.pid
    start program = "/etc/init.d/clamav-milter start"
    stop  program = "/etc/init.d/clamav-milter stop"
    if failed unix /var/run/clamav/clamav-milter.ctl then restart
    group virus


Does it work now? Errors propagate upwards and it could be a problem with the depending files. Probably not though.

2) The only other thing that can go wrong here is reading of the pid in the pid file and that getpgid() fails. To get more debug info you could replace the function Util_isProcessRunning in util.c with this one and recompile monit. Send us the output when you run "monit validate"

int Util_isProcessRunning(Service_T s) {
        pid_t  pid;
        ASSERT(s);
        errno= 0;
        if((pid= Util_getPid(s->path))) {
                log("PID: Got pid %d from %s\n", pid, s->path);
                if( (getpgid(pid) > -1) || (errno == EPERM) ) {
                        log("PID: OK\n");
                        return pid;
                }
                log("PID: Error -- %s\n", STRERROR);
        } else
                log("PID: No pid found at %s\n", s->path);
        Util_resetInfo(s);
        return FALSE;
}

Alternatively you could run gdb on the monit executable as shown below to the same effect.

hauk:[~/src/monit]gdb ./monit
GNU gdb 6.1-20040303 (Apple version gdb-434) (Wed Nov 2 17:28:16 GMT 2005)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "powerpc-apple-darwin"...Reading symbols for shared libraries ..... done

(gdb) b Util_isProcessRunning
Breakpoint 1 at 0x13298: file util.c, line 1142.
(gdb) r validate
Starting program: /Users/hauk/src/monit/monit validate
Reading symbols for shared libraries . done

Breakpoint 1, Util_isProcessRunning (s=0x400c40) at util.c:1142
1142      ASSERT(s);
(gdb) n
1144      errno= 0;
(gdb)
1145      if((pid= Util_getPid(s->path)))
(gdb)
1146        if( (getpgid(pid) > -1) || (errno == EPERM) )
(gdb) n
1148      Util_resetInfo(s);
(gdb) p pid
$1 = 50
(gdb) p (char*)strerror((int)errno)
$1 = 0x90199c14 "No such process"
(gdb) q
The program is running.  Exit anyway? (y or n) y

--
Jan-Henrik Haukeland
Mobil +47 97141255





reply via email to

[Prev in Thread] Current Thread [Next in Thread]