我有一个不作为守护进程运行的
ruby进程(它在前台运行),但可以生成一个pid文件.我的问题是Monit总是希望监控后台/守护进程吗?
我过去使用过Bluepill,这是默认行为:
Note that since we specified a PID file and start command,bluepill assumes the process will daemonize itself. If we wanted bluepill to daemonize it for us,we can do (note we still need to specify a PID file): process.daemonize = true
monit有类似的东西吗? AFAIK,只要进程(守护进程或非进程)可以创建一个PID文件,Monit将检测它是否自己守护进程并且不会对其进行守护,反之亦然……
谢谢
它可以正常工作..你可以让它检查进程的pid文件,基本上monit正在做的是做一个
ps aux | grep pid#
如果它在那里它认为它已经启动并运行.如果您没有pid文件,您也可以通过类似的方式检查进程
check process myprocessname matching "myprocessname"
这几乎是一个
ps aux | grep myprocessname