monit-general
[Top][All Lists]
Advanced

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

Process being restarted by monit validate even if it is running


From: Mehul Ved
Subject: Process being restarted by monit validate even if it is running
Date: Fri, 7 Mar 2014 09:03:13 +0000

Hi,

  I have a process which I am monitoring with following rules


check process v2api with pidfile /var/run/node/v2.pid
  start program = "/usr/local/bin/nodeinit v2 start"
    as uid root
  stop program = "/usr/local/bin/nodeinit v2 stop"
    as uid root
  if failed host 127.0.0.1 port 10400 protocol http
    request /api/v2/ping
    with timeout 10 seconds
    then restart
  if 5 restarts within 10 cycles then alert

Before running monit validate, I checked the pidfile of the process

# grep [0-9]* /var/run/node/
/var/run/node/v2.pid:31566

# cat /var/run/node/v2.pid
31566

I also verified with ps on the process id

# ps aux | grep 31566
root     31566  0.3  1.7 605684 29820 ?        Sl   05:24   0:01 /usr/local/bin/node /usr/local/share/nodeapis/server.js


Now when I run 

# monit validate --verbose
'v2api' Error testing process id [31566] -- No such process
'v2api' process is not running
Does not exist notification is sent to address@hidden
'v2api' trying to restart
'v2api' stop: /usr/local/bin/nodeinit
'v2api' Error testing process id [31566] -- No such process
/usr/local/bin/nodeinit: line 80: kill: (31566) - No such process
Killed v2 process with pid 31566
monit: pidfile '/var/run/node/v2.pid' does not exist
monit: pidfile '/var/run/node/v2.pid' does not exist
'v2api' start: /usr/local/bin/nodeinit
monit: pidfile '/var/run/node/v2.pid' does not exist
v2 has started with PID: 1150

It complains that the process is not running.

I am using the development version of monit that Martin linked to a couple of days back, with websocket support.

# monit --version
This is Monit version 5.8
Copyright (C) 2001-2014 Tildeslash Ltd. All Rights Reserved.









reply via email to

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