I have a problem, I have a control executables which monitor few process and if anyone died then it will restart it. On windows we are doing with WaitFOrMultipleObject where process handle passed in the array of handle. If any process die we getting acknowledged by WaitForMultipleObject.
Now we have to implement it on Linux. How we will do it? Wait is only work for one process id and while we have to monitor multiple process.
Sounds like you're looking for process groups. You can waitpid(2) for a process group using -pidgroup (i.e. the negative value of the pid group) as the value for pid in the call, or -1 to wait for any child process.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With