简体   繁体   中英

How to run a normal C program using monit

我试图监视Monit中的普通C程序,但我不知道如何运行该程序,应在Monit的控制文件中设置什么配置。

You need to get the PID of the program to be able to monitor it with Monit. Some programs allow commandline arguments to give the location of a file that they are to write their PID to. Otherwise, you can try starting the program from a wrapper script that writes the PID to a known location, eg /usr/bin/myprogram & && jobs -p > /var/run/myprogram.pid in bash .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM