title: Auto kill child process when parent process is died
body: <p>How to <strong>auto kill child process</strong> when parent process is <strong>died</strong> in <strong>Golang</strong> ?</p>
  
  <p>The child process is invoked by <strong>exec.Command()</strong>.</p>
  
  <p>For example,</p>
  
  <p>The parent process pid is: 28290, there is three child process: 32062, 32473, 33455. </p>
  
  <p># ps axo pid, ppid, pgid | grep 28290</p>
  
  <p>PID      PPID  PGID</p>
  
  <p>28290     1   28289</p>
  
  <p>32062 28290 28289</p>
  
  <p>32473 28290 28289</p>
  
  <p>33455 28290 28289</p>
  
  <p>The four process have the same PGID=28289.</p>
  
  <p>When I kill the parent process 28290(<strong>kill the 28290 in linux, kill -9 28290</strong>), the child processes does not exit().</p>
  
  <p>Is there any options to auto kill the child processes?</p>