I have a question about Monit.
i've wrote a multithread C++ process. The main and some of the thread that it invoke, ar critical for my application and needs to live for indefinite time.
include <thread.h>
.......
std::thread Thread_1( );
Thread_1.detach();
std::thread Thread_2();
Thread_2.detach();
std::thread Thread_3();
Thread_3.detach();
How can I create a .pid file in order to configuring Monit?
Do i need to supervise all thread PID separately or it is sufficient to monitor only the main? if I type in my shell
pidof main
I can get the PID of main (not the pid of the other threads), but it changes after reboot
Many thanks for your patience