title: Kill bash and child process
body: <p>My C program executes commands in a bash shell.  To do this, I <code>fork</code> and in the child process I run: </p>
  
  <pre><code>char* command = "..."; /* provided by user */
  execlp("/bin/bash", "bash", "-c", command, NULL);
  </code></pre>
  
  <p>If this is a long running command, I would like to have the option of killing it.  For example, say I'm doing:</p>
  
  <pre><code>execlp("/bin/bash", "bash", "-c", "find / test", NULL);
  </code></pre>
  
  <p>After this, I know the PID of the child that is executing bash, but bash is forking a separate process to execute find.</p>
  
  <pre><code>$ ps aux | grep find
  zmb       7802  0.0  0.1   5252  1104 pts/1    S+   11:17   0:00 bash -c find / test
  zmb       7803  0.0  0.0   4656   728 pts/1    S+   11:17   0:00 find / test
  </code></pre>
  
  <p>I can kill the bash process (7802), but the find process (7803) still continues to execute.  How can I ensure that the bash process propagates signals to it's children?  </p>