[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: clamav-milter's pid
From: |
Martin Pala |
Subject: |
Re: clamav-milter's pid |
Date: |
Fri, 07 Apr 2006 22:47:24 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20060205 Debian/1.7.12-1.1 |
Hi,
see monit FAQ - example:
3. Q: I have a program that does not create its own pid file. Since
monit requires all programs to have a pid file, what do I do?
A: Create a wrapper script and have the script create a pid file
before it starts the program. Below you will find an example
script for starting an imaginary program (a Java program in this
case). Assuming that the script is saved in a file called
/bin/xyz, you can call this script from monit by using the
following in monitrc:
check process xyz with pidfile /tmp/xyz.pid
start = "/bin/xyz start"
stop = "/bin/xyz stop"
--8<--- (cut here)
#!/bin/bash
export JAVA_HOME=/usr/local/java/
export DISPLAY=localhost:0.0
CLASSPATH=ajarfile.jar:.
case $1 in
start)
echo $$ > /tmp/xyz.pid;
exec 2>&1 java -cp ${CLASSPATH} org.something.with.main \
1>/tmp/xyz.out
;;
stop)
kill `cat /tmp/xyz.pid` ;;
*)
echo "usage: xyz {start|stop}" ;;
esac
--8<---- (cut here)
Martin
Mike Pepe wrote:
Hi all,
Just scanned the archives and I see a few people mentioned that
monitoring clamav-milter doesn't work.
Add me to that list.
I'm not sure if anyone noticed, but clamav-milter has a negative pid.
# cat /var/run/clamav/clamav-milter.pid
-12611
of course, the actual pid the process is running is not negative.
could this be affecting monit?
thanks
-Mike
--
To unsubscribe:
http://lists.nongnu.org/mailman/listinfo/monit-general
- clamav-milter's pid, Mike Pepe, 2006/04/07
- Re: clamav-milter's pid,
Martin Pala <=
- Re: clamav-milter's pid, Mike Pepe, 2006/04/07
- Re: clamav-milter's pid, Martin Pala, 2006/04/07
- Re: clamav-milter's pid, Mike Pepe, 2006/04/07
- Re: clamav-milter's pid, Martin Pala, 2006/04/07
- Re: clamav-milter's pid, Mike Pepe, 2006/04/07
- Re: clamav-milter's pid, Martin Pala, 2006/04/07
- Re: clamav-milter's pid, Mike Pepe, 2006/04/07