Thanks for report, the problem is fixed in cvs. Patch for 4.10.1 is attached.

Martin


Aaron Scamehorn wrote:
Hello,
We've first started experiencing this problem in 4.9, and it continues
in 4.10.1:
We use monit to start & stop our processes daily. Every day at 6am we
start them, and every day at 11pm we stop them.

Occasionally, at startup, monit will start a process, then in the same
second, start it again (thinking the first invocation failed).  Below is
the syslog output:
Dec 19 07:05:01 wolverine monit[18493]: start service 'trdClientCap' on
user request
Dec 19 07:05:01 wolverine monit[18493]: 'trdClientCap' start:
/cogcap/ccts/bin/trdClientCap
Dec 19 07:05:01 wolverine monit[18493]: 'trdClientCap' process is not
running
Dec 19 07:05:01 wolverine monit[18493]: 'trdClientCap' trying to restart
Dec 19 07:05:01 wolverine monit[18493]: 'trdClientCap' stop:
/cogcap/ccts/bin/trdClientCap
Dec 19 07:05:02 wolverine monit[18493]: 'trdClientCap' start:
/cogcap/ccts/bin/trdClientCap
Dec 19 07:05:11 wolverine monit[18493]: 'trdClientCap' failed to start
Dec 19 07:05:12 wolverine monit[18493]: 'trdClientCap' process is not
running
Dec 19 07:05:12 wolverine monit[18493]: 'trdClientCap' trying to restart
Dec 19 07:05:12 wolverine monit[18493]: 'trdClientCap' start:
/cogcap/ccts/bin/trdClientCap
Dec 19 07:05:12 wolverine monit[18493]: 'trdClientCap' failed to start
Dec 19 07:05:13 wolverine monit[18493]: 'trdClientCap' started
Dec 19 07:05:22 wolverine monit[18493]: 'trdClientCap' process is
running with pid 24708


I believe the first occurance of the "process is not running" and
"trying to restart" are the problem.  Monit is not even waiting 1 second
to determine if startup failed.

The end result is that I now have 2 processes running.


Thanks,
Aaron



_______________________________________________
monit-dev mailing list
monit-dev@nongnu.org
http://lists.nongnu.org/mailman/listinfo/monit-dev
Index: control.c
===================================================================
RCS file: /sources/monit/monit/control.c,v
retrieving revision 1.108
diff -u -r1.108 control.c
--- control.c   8 Mar 2008 01:08:39 -0000       1.108
+++ control.c   13 Mar 2008 21:47:33 -0000
@@ -309,9 +309,10 @@
        LogError("Warning: Failed to create the start controller thread. "
            "Thread error -- %s.\n", strerror(status));
       }
+    } else {
+      Util_monitorSet(s);
     }
   }
-  Util_monitorSet(s);
 }
 
 
@@ -480,6 +481,8 @@
     Run.wait_start--;
   END_LOCK;
 
+  Util_monitorSet(s);
+
   return NULL;
   
 }
_______________________________________________
monit-dev mailing list
monit-dev@nongnu.org
http://lists.nongnu.org/mailman/listinfo/monit-dev

Reply via email to