Monit启动了该过程的多个实例

时间:2014-07-08 12:14:07

标签: linux

我们在使用monit的Arch Linux中遇到问题,其中多个实例实例正在实例化。

脚本是: *检查过程检查程序     匹配检查程序

start program = "/usr/bin/check/checkprogram" as uid localuser
stop program  = "/bin/bash /usr/bin/scripts/killprocess.sh checkprogram"

如果3个在20个周期内重启,则停止*

killprocess.sh包含以下脚本:

*kill $(ps -C "$1" -o pid | grep [[:digit:]])*

当我看到monit日志时,它会显示:

*[UTC Jul  5 17:53:32] error    : 'checkprogram' process is not running
[UTC Jul  5 17:53:32] info     : 'checkprogram' trying to restart
[UTC Jul  5 17:53:32] info     : 'checkprogram' start: /usr/bin/check/checkprogram
[UTC Jul  5 17:53:36] info     : 'checkprogram' process is running with pid 19344
[UTC Jul  6 06:55:01] error    : 'checkprogram' process PID changed from 19344 to 15773
[UTC Jul  6 06:55:01] error    : 'checkprogram' process PPID changed from 1 to 19344
[UTC Jul  6 06:55:05] error    : 'checkprogram' process PID changed from 15773 to 19344
[UTC Jul  6 06:55:05] error    : 'checkprogram' process PPID changed from 19344 to 1
[UTC Jul  6 06:55:09] info     : 'checkprogram' process PID has not changed since last cycle
[UTC Jul  6 06:55:09] info     : 'checkprogram' process PPID has not changed since last cycle
[UTC Jul  6 14:17:31] error    : 'checkprogram' process PID changed from 19344 to 14511
[UTC Jul  6 14:17:31] error    : 'checkprogram' process PPID changed from 1 to 19344
[UTC Jul  6 14:17:35] error    : 'checkprogram' process PID changed from 14511 to 19344
[UTC Jul  6 14:17:35] error    : 'checkprogram' process PPID changed from 19344 to 1
[UTC Jul  6 14:17:39] info     : 'checkprogram' process PID has not changed since last cycle
[UTC Jul  6 14:17:39] info     : 'checkprogram' process PPID has not changed since last cycle
[UTC Jul  7 00:28:26] error    : 'checkprogram' process PID changed from 19344 to 10938
[UTC Jul  7 00:28:26] error    : 'checkprogram' process PPID changed from 1 to 463
[UTC Jul  7 00:28:30] error    : 'checkprogram' process PID changed from 10938 to 19344
[UTC Jul  7 00:28:30] error    : 'checkprogram' process PPID changed from 463 to 1
[UTC Jul  7 00:28:34] info     : 'checkprogram' process PID has not changed since last cycle
[UTC Jul  7 00:28:34] info     : 'checkprogram' process PPID has not changed since last cycle
[UTC Jul  7 18:40:41] error    : 'checkprogram' process PID changed from 19344 to 10731
[UTC Jul  7 18:40:41] error    : 'checkprogram' process PPID changed from 1 to 463
[UTC Jul  7 18:40:45] error    : 'checkprogram' process PID changed from 10731 to 19344
[UTC Jul  7 18:40:45] error    : 'checkprogram' process PPID changed from 463 to 1
[UTC Jul  7 18:40:49] info     : 'checkprogram' process PID has not changed since last cycle
[UTC Jul  7 18:40:49] info     : 'checkprogram' process PPID has not changed since last cycle
[UTC Jul  8 07:46:43] error    : 'checkprogram' process is not running
[UTC Jul  8 07:46:43] info     : 'checkprogram' trying to restart
[UTC Jul  8 07:46:43] info     : 'checkprogram' start: /usr/bin/check/checkprogram
[UTC Jul  8 07:46:47] info     : 'checkprogram' process is running with pid 11517*

有谁知道为什么要启动多个实例?任何调试此问题的提示也是受欢迎的。

此致 ossk

0 个答案:

没有答案