apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe, Jr." <wr...@rowe-clan.net>
Subject Re: Trouble killing a process
Date Thu, 13 Dec 2007 18:48:58 GMT
Antonia Tugores wrote:
> Hi all,
> I'm having some troubles killing a process (and its subprocesses).
> The process type is APR_SHELLCMD_ENV, and when I call the apr_proc_kill with 
> the signal SIGABRT (with SIGKILL the results are the same), the parent 
> process (sh) dies but the child (sleep) doesn't.
> main_program
>   /bin/sh -c ./"sleep.sh" 1 1 100  <---- dies
>     ./sleep.sh 1 1 100                 <---- remains
> How can I kill the process and its subprocesses?

There's next to no way to enforce this behavior in a cross platform
manner.  Even different shells on the same OS are going to exhibit
different features.  Cleaning up your processes appropriately is
important.  And this goes for shells, who should be watching for
SIGKILL/SIGABRT and reacting appropriately to the processes that
they had created.

This happens to be solaris?  /usr/xpg4/bin/sh is a bit more reliable.

View raw message