title: Script for killing defunct process with parent 1
body: <p>I have a process who is a child of init (ppid = 1), something bad happened in my processes
  and the process became zombie -</p>
  
  <pre><code>ps -ef | grep defunct
  root     10384     1  0 Jun12 ?        00:48:22 [myProc] &lt;defunct&gt;
  </code></pre>
  
  <p>I tried killing it with kill -9 , pkill and killall nothing helps.
  I tried sending SIGCHLD to its parent which is the init process but that does not help either.</p>
  
  <p>Init is not reaping the process for some reason (probably a stuck I/O - bug in our code yet to be discovered)</p>
  
  <p>It seems that the only way to get rid of this is to reboot the server, which is not
  an acceptable solution.</p>
  
  <p>How do I kill this process, or prevent this from happening in the future.</p>
  
  <p>I <strong>can</strong> control the way I launch the process if this can prevent it from becoming defunct.</p>
  
  <p>The process is obviously holding for resources which I need to use, hence leaving it to just hang there doesn't help.</p>