wait and waitpid would not work because a Process A would wait for process B(which is a parent of the daemon), process B immediately exits and process A would be notified.
In my case, I want to query the status of process C(which is child of process B) / grandchild of process A which is a child of init after process B terminates,
fork fork
process A -------------> Process B --------------> Process C
Process A should query the status of process C
Once process C is daemon, Process C would be the the child of init.
Can we do something by making a process A to be a daemon (child of init), because process A and process C are sibling, can siblings query the status of each other.
IPC is not an option for me, because there are several service and process A do not know how and what is the process C, it should just monitor so many child process.
Regards,
Yash.