<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 -------------&gt; Process B --------------&gt; 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">&lt;<a href="mailto:sudipm.mukherjee@gmail.com" target="_blank">sudipm.mukherjee@gmail.com</a>&gt;</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 &lt;<a href="mailto:nizamhaider786@gmail.com">nizamhaider786@gmail.com</a>&gt; wrote:<br>
&gt; Anuz Pratap Singh Tomar &lt;chambilkethakur &lt;at&gt; <a href="http://gmail.com" target="_blank">gmail.com</a>&gt; writes:<br>
&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; On Tue, Jan 6, 2015 at 3:22 PM, Yash Jain &lt;yash2learn &lt;at&gt; <a href="http://gmail.com" target="_blank">gmail.com</a>&gt;<br>
&gt; wrote:Hello All,I have one dumb question,<br>
&gt;&gt; I wanted to write a process which monitors the exit status of the daemon,<br>
&gt;&gt;<br>
&gt;&gt; The Main process would fork a service, which would internally fork a child<br>
&gt; and , exit from the process. If main process wants to query the status of<br>
&gt; the daemon, how it can be achived.<br>
&gt;&gt;<br>
&gt;&gt; For ex :<br>
&gt;&gt; Process A would call a syslog service, which would internally fork a<br>
&gt; child, daemon it and exit, so if process A wants to wait for the syslog<br>
&gt; process, is it possible.<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; waitpid()<br>
&gt;&gt;<br>
&gt;&gt; signal()<br>
&gt; WIFEXITED<br>
&gt; 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>
&gt;&gt;<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>