ubuntu – Monit – Daemonize非守护进程?

我有一个不作为守护进程运行的 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

相关文章

目录前言一、创建Hadoop用户二、更新apt和安装Vim编辑器三、...
原文连接:https://www.cnblogs.com/yasmi/p/5192694.html ...
电脑重启后,打开VirtualBox,发现一直用的虚拟机莫名的消失...
参见:https://blog.csdn.net/weixin_38883338/article/deta...
Ubuntu 18.04 LTS 已切换到 Netplan 来配置网络接口。Netpla...
介绍每个 Web 服务都可以通过特定的 URL 在 Internet 上访问...