Monit和清漆

我正在使用下面的configurationmonit

set daemon 30 check process varnish with pidfile /var/run/varnishd.pid if failed host www.hatchedbyyolk.com port 80 protocol http and request "/monit-check-url" then exec "/root/scripts/varnish_restart.sh" set httpd port 2812 and use address localhost allow localhost 

monit开始就好,但monit status显示如下

 Process 'varnish' status Does not exist monitoring status monitored data collected Sun Oct 13 00:37:03 2013 

由于某些未知的原因,启动和停止命令对清漆没有影响,所以我使用/root/scripts/varnish_restart.sh这个脚本

 #! /bin/sh killall varnishd varnishd -f /etc/varnish/default.vcl -s malloc,1G -a 0.0.0.0:80 

不用说有些事情是错的,清漆不会自行重启。

在这种情况下,“不存在”是什么意思?

我错过了什么吗?

编辑

我刚才也检查了/var/run/varnish.pid文件中的PID与我在top可以看到的任何PID不匹配

PID文件与正在运行的进程不匹配,因为您没有使用init脚本 – 在服务启动时没有写入该文件。

对于要更新的​​PID文件,您应该将-P /var/run/varnish.pid添加到您的varnishd命令行 – 或者更好的,找出为什么init脚本不能正常工作并修复它。