[Top][All Lists]

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

Re: clamav-milter's pid

From: Mike Pepe
Subject: Re: clamav-milter's pid
Date: Fri, 07 Apr 2006 16:58:40 -0400
User-agent: Thunderbird 1.5 (Windows/20051201)

Martin Pala wrote:

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/
        start = "/bin/xyz start"
        stop = "/bin/xyz stop"

          --8<--- (cut here)

          export JAVA_HOME=/usr/local/java/
          export DISPLAY=localhost:0.0

          case $1 in
           echo $$ > /tmp/;
           exec 2>&1 java -cp ${CLASSPATH} org.something.with.main \
           kill `cat /tmp/` ;;
           echo "usage: xyz {start|stop}" ;;

          --8<---- (cut here)


I just kinda tried something like that.

In the script that starts clamav-milter, I did a little cat/cut thing to remove the - and write a new pid file. But, even when using that pid file, monit still thinks clamav-milter is not running.


reply via email to

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