[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[monit] Monit won't start any process. Please help.
From: |
olo |
Subject: |
[monit] Monit won't start any process. Please help. |
Date: |
Tue, 02 Dec 2008 14:43:51 +0100 |
User-agent: |
Mozilla-Thunderbird 2.0.0.16 (X11/20080724) |
Hi, I don't know why but monit fails to start processes, and its the
same for version 4.10 or 5.0 beta4. I want it to keep an eye on imwheel
process, which occasionally hangs and consumes lots of CPU. The process
has no PID file, so I made it create it. Monit does kill the
process if I start it manually. I tried writing stop/start
commands all inside .monitrc and in separate executable files called
from within .monitrc with the same results. They do work properly if I
run them directly from the command line. Here is
my configuration, and log:
CONFIG (~/.monitrc):
set httpd port 2812
use address localhost
allow localhost
allow admin:monit
set daemon 5
check process imwheel with pidfile /tmp/imwheel.pid
start program = "/usr/bin/imwheel -k -X :0.0; /bin/pidof imwheel >
/tmp/imwheel.pid"
stop program = "/usr/bin/killall imwheel; /bin/cat /dev/null >
/tmp/imwheel.pid"
if cpu usage > 3% for 1 cycles then restart
This is what is logged after starting monit and after short time giving
it this command: monit start imwheel
(it won't start it neither by itself nor after this direct command)
[CET Dec 2 09:45:25] debug : monit: pidfile '/home/olo/.monit.pid'
does not exist
[CET Dec 2 09:45:25] info : Starting monit daemon with http
interface at [localhost:2812]
[CET Dec 2 09:45:25] info : Starting monit HTTP server at
[localhost:2812]
[CET Dec 2 09:45:25] info : monit HTTP server started
[CET Dec 2 09:45:25] info : 'olek' Monit started
[CET Dec 2 09:45:25] error : http server: Could not create a server
socket at port 2812 -- Address already in use
[CET Dec 2 09:45:25] error : monit HTTP server not available
[CET Dec 2 09:45:25] error : 'imwheel' process is not running
[CET Dec 2 09:45:25] info : 'imwheel' trying to restart
[CET Dec 2 09:45:25] debug : Monitoring disabled -- service imwheel
[CET Dec 2 09:45:25] info : 'imwheel' start: /usr/bin/imwheel
[CET Dec 2 09:45:55] error : 'imwheel' failed to start
[CET Dec 2 09:45:55] debug : Monitoring enabled -- service imwheel
[CET Dec 2 09:46:00] info : 'olek' Monit has not changed
[CET Dec 2 09:46:00] error : 'imwheel' process is not running
[CET Dec 2 09:46:00] info : 'imwheel' trying to restart
[CET Dec 2 09:46:00] debug : Monitoring disabled -- service imwheel
[CET Dec 2 09:46:00] info : 'imwheel' start: /usr/bin/imwheel
[CET Dec 2 09:46:30] error : 'imwheel' failed to start
[CET Dec 2 09:46:30] debug : Monitoring enabled -- service imwheel
[CET Dec 2 09:46:35] error : 'imwheel' process is not running
[CET Dec 2 09:46:35] info : 'imwheel' trying to restart
[CET Dec 2 09:46:35] debug : Monitoring disabled -- service imwheel
[CET Dec 2 09:46:35] info : 'imwheel' start: /usr/bin/imwheel
And here is the output of starting monit, when imwheel is already runing
with pid file set
olek [cd] ~ 08-12-02
9:49AM
olek% ./imwheelinit
INFO: imwheel started (pid=11735)
olek [./imwheelinit] ~ 08-12-02 9:49AM
olek% cat /tmp/imwheel.pid
11735
and giving: monit stop imwheel, does kill imwheel but ...
[CET Dec 2 09:51:36] debug : monit: pidfile '/home/olo/.monit.pid'
does not exist
[CET Dec 2 09:51:36] info : Starting monit daemon with http
interface at [localhost:2812]
[CET Dec 2 09:51:36] info : Starting monit HTTP server at
[localhost:2812]
[CET Dec 2 09:51:36] error : http server: Could not create a server
socket at port 2812 -- Address already in use
[CET Dec 2 09:51:36] error : monit HTTP server not available
[CET Dec 2 09:51:36] info : monit HTTP server started
[CET Dec 2 09:51:36] info : 'olek' Monit started
[CET Dec 2 09:51:36] debug : 'imwheel' zombie check succeeded
[status_flag=0000]
[CET Dec 2 09:51:36] debug : 'imwheel' cpu usage check succeeded
[current cpu usage=0.0%]
[CET Dec 2 09:51:41] info : 'olek' Monit has not changed
[CET Dec 2 09:51:41] debug : 'imwheel' zombie check succeeded
[status_flag=0000]
[CET Dec 2 09:51:41] debug : 'imwheel' PID has not changed since
last cycle
[CET Dec 2 09:51:41] debug : 'imwheel' PPID has not changed since
last cycle
[CET Dec 2 09:51:41] debug : 'imwheel' cpu usage check succeeded
[current cpu usage=0.0%]
[CET Dec 2 09:51:46] debug : 'imwheel' zombie check succeeded
[status_flag=0000]
[CET Dec 2 09:51:46] debug : 'imwheel' PID has not changed since
last cycle
[CET Dec 2 09:51:46] debug : 'imwheel' PPID has not changed since
last cycle
[CET Dec 2 09:51:46] debug : 'imwheel' cpu usage check succeeded
[current cpu usage=0.0%]
[CET Dec 2 09:51:51] debug : 'imwheel' zombie check succeeded
[status_flag=0000]
[CET Dec 2 09:51:51] debug : 'imwheel' PID has not changed since
last cycle
[CET Dec 2 09:51:51] debug : 'imwheel' PPID has not changed since
last cycle
[CET Dec 2 09:51:51] debug : 'imwheel' cpu usage check succeeded
[current cpu usage=0.0%]
[CET Dec 2 09:51:56] debug : 'imwheel' Error testing process id
[11735] -- No such process
[CET Dec 2 09:51:56] error : 'imwheel' process is not running
[CET Dec 2 09:51:56] info : 'imwheel' trying to restart
[CET Dec 2 09:51:56] debug : Monitoring disabled -- service imwheel
[CET Dec 2 09:51:56] debug : 'imwheel' Error testing process id
[11735] -- No such process
[CET Dec 2 09:51:56] debug : 'imwheel' Error testing process id
[11735] -- No such process
[CET Dec 2 09:51:56] info : 'imwheel' start: /usr/bin/imwheel
[CET Dec 2 09:51:56] debug : 'imwheel' Error testing process id
[11735] -- No such process
.... .... ....
[CET Dec 2 09:52:25] debug : 'imwheel' Error testing process id
[11735] -- No such process
[CET Dec 2 09:52:26] debug : 'imwheel' Error testing process id
[11735] -- No such process
[CET Dec 2 09:52:26] error : 'imwheel' failed to start
[CET Dec 2 09:52:26] debug : Monitoring enabled -- service imwheel
[CET Dec 2 09:52:31] debug : 'imwheel' Error testing process id
[11735] -- No such process
[CET Dec 2 09:52:31] error : 'imwheel' process is not running
[CET Dec 2 09:52:31] info : 'imwheel' trying to restart
[CET Dec 2 09:52:31] debug : Monitoring disabled -- service imwheel
[CET Dec 2 09:52:31] debug : 'imwheel' Error testing process id
[11735] -- No such process
[CET Dec 2 09:52:31] debug : 'imwheel' Error testing process id
[11735] -- No such process
[CET Dec 2 09:52:31] info : 'imwheel' start: /usr/bin/imwheel
[CET Dec 2 09:52:31] debug : 'imwheel' Error testing process id
[11735] -- No such process
[CET Dec 2 09:52:31] debug : 'imwheel' Error testing process id
[11735] -- No such process
[CET Dec 2 09:52:32] debug : 'imwheel' Error testing process id
[11735] -- No such process
[CET Dec 2 09:52:33] debug : 'imwheel' Error testing process id
[11735] --
Still, it does just part of the job, killing imwheel, but won't clean
pid file as I intended by putting cat /dev/null > /tmp/imwheel.pid in
my stop command:
olek [monit quit] ~ 08-12-02
9:54AM
olek% cat /tmp/imwheel.pid
11735
If I just execute the comands:
/usr/bin/imwheel -k -X :0.0; /bin/pidof imwheel > /tmp/imwheel.pid
and
/usr/bin/killall imwheel; /bin/cat /dev/null > /tmp/imwheel.pid
from the command line everything seems to work perfectly fine. It is not
imwheel specific, as I tried same thing with other programs, such as
sleep or cat. killall and kill seems to work fine with monit. Other
programs not. I suspect it's something with pid, but monit does see
imwheel with correct pid when I start it manually (monit status does
show it, and everything is correct).
Still won't do the stop command as expected. I use zsh if it makes any
difference, but tried running everything from bash with the same result.
I have Debian/testing.
What am I missing? Help will be greatly appreciated.
- [monit] Monit won't start any process. Please help.,
olo <=