Does the content of /var/run/stream.pid match the running process ID?


I'll ask the obvious - have you done a 'monit reload'? I've run into circumstances when initiating monitoring of a new service where things can get somewhat 'out of sync', and one or two 'monit reload's are necessary to get it working properly.


On 11/29/16 09:46, Anthony Griffiths wrote:
I'm running centos 7 and I have a bash script that streams video, it's
called /etc/init.d/stream and it works fine. When started the stream
script produces a pid file at /var/run/stream.pid but monit for some
reason can't see the pid file and it keeps stopping and then
restarting the stream.
In /etc/monitrc I have this:

check process stream with pidfile /var/run/stream.pid
        start program = "/etc/init.d/stream start" with timeout 10 seconds
        stop program = "/etc/init.d/stream stop &&"

and when I do tail -f /var/log/monit.log I see this:
---------------------------
[GMT Nov 29 17:36:54] error    : 'stream' process is not running
[GMT Nov 29 17:36:54] info     : 'stream' trying to restart
[GMT Nov 29 17:36:54] info     : 'stream' start: /etc/init.d/stream
[GMT Nov 29 17:37:44] error    : 'stream' failed to start (exit status
0) -- /etc/init.d/stream: Starting service¦
Service started

[GMT Nov 29 17:38:14] error    : 'stream' process is not running
[GMT Nov 29 17:38:14] info     : 'stream' trying to restart
[GMT Nov 29 17:38:14] info     : 'stream' start: /etc/init.d/stream
[GMT Nov 29 17:39:04] error    : 'stream' failed to start (exit status
0) -- /etc/init.d/stream: Starting service¦
Service started

[GMT Nov 29 17:39:34] error    : 'stream' process is not running
[GMT Nov 29 17:39:34] info     : 'stream' trying to restart
[GMT Nov 29 17:39:34] info     : 'stream' start: /etc/init.d/stream
[GMT Nov 29 17:40:25] error    : 'stream' failed to start (exit status
0) -- /etc/init.d/stream: Starting service¦
Service started

[GMT Nov 29 17:40:55] error    : 'stream' process is not running
[GMT Nov 29 17:40:55] info     : 'stream' trying to restart
[GMT Nov 29 17:40:55] info     : 'stream' start: /etc/init.d/stream
[GMT Nov 29 17:41:45] error    : 'stream' failed to start (exit status
0) -- /etc/init.d/stream: Starting service¦
Service started

[GMT Nov 29 17:42:15] error    : 'stream' process is not running
[GMT Nov 29 17:42:15] info     : 'stream' trying to restart
[GMT Nov 29 17:42:15] info     : 'stream' start: /etc/init.d/stream
[GMT Nov 29 17:43:05] error    : 'stream' failed to start (exit status
0) -- /etc/init.d/stream: Starting service¦
Service started
(over and over and over)
----------------------------------

when the stream is running the pid file at /var/run/stream.pid is
always there because I've check it.
why can't monit see the pid file?

--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general


--
Paul Theodoropoulos
www.anastrophe.com

--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general

Reply via email to