<div dir="ltr">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.<div>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, </div><div><br></div><div> fork fork</div><div>process A -------------> Process B --------------> Process C</div><div><br></div><div>Process A should query the status of process C</div><div><br></div><div>Once process C is daemon, Process C would be the the child of init.</div><div><br></div><div>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.</div><div><br></div><div>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.</div><div><br></div><div>Regards,</div><div>Yash.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jan 7, 2015 at 1:35 PM, Sudip Mukherjee <span dir="ltr"><<a href="mailto:sudipm.mukherjee@gmail.com" target="_blank">sudipm.mukherjee@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Wed, Jan 7, 2015 at 12:57 AM, Nizam Haider <<a href="mailto:nizamhaider786@gmail.com">nizamhaider786@gmail.com</a>> wrote:<br>
> Anuz Pratap Singh Tomar <chambilkethakur <at> <a href="http://gmail.com" target="_blank">gmail.com</a>> writes:<br>
><br>
>><br>
>><br>
>><br>
>> On Tue, Jan 6, 2015 at 3:22 PM, Yash Jain <yash2learn <at> <a href="http://gmail.com" target="_blank">gmail.com</a>><br>
> wrote:Hello All,I have one dumb question,<br>
>> I wanted to write a process which monitors the exit status of the daemon,<br>
>><br>
>> The Main process would fork a service, which would internally fork a child<br>
> and , exit from the process. If main process wants to query the status of<br>
> the daemon, how it can be achived.<br>
>><br>
>> For ex :<br>
>> Process A would call a syslog service, which would internally fork a<br>
> child, daemon it and exit, so if process A wants to wait for the syslog<br>
> process, is it possible.<br>
>><br>
>><br>
>> waitpid()<br>
>><br>
>> signal()<br>
> WIFEXITED<br>
> WEXITSTATUS<br>
<br>
</span>doubt --<br>
wait and waitpid will be for the parent process to wait for its child.<br>
but for a daemon the parent is init .<br>
so the exit status should be sent to init and not to his process. then<br>
how does he get the exit status<br>
<span class="HOEnZb"><font color="#888888"><br>
sudip<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
>><br>
<br>
_______________________________________________<br>
Kernelnewbies mailing list<br>
<a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
<a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
</div></div></blockquote></div><br></div>