Could I trouble you or anyone else to help me implement this feature? I
have some test processes, one that exits cleanly on sigterm and one that
refuses and must be killed abruptly. In some experimentation on GHCi,
things seem to go alright, but in test, either process reports that it has
terminated with 15, which is incorrect.
Test code:
https://github.com/MichaelXavier/Angel/blob/sigkill/test/Angel/JobSpec.hs#L38
Relevant implementation code:
https://github.com/MichaelXavier/Angel/blob/sigkill/src/Angel/Job.hs#L161
https://github.com/MichaelXavier/Angel/blob/sigkill/src/Angel/Process.hs#L40
I've spent quite a bit of time trying different solutions to this and have
failed to get the tests to pass.
On Sat, Sep 21, 2013 at 9:24 PM, Brandon Allbery allber...@gmail.comwrote:
On Sat, Sep 21, 2013 at 11:12 PM, Michael Xavier
mich...@michaelxavier.net wrote:
I've run into some strangeness with the process package. When you kill
some processes on the command line you correctly get a non-zero exit
status. However when using the process package's terminateProcess (which
sends a SIGTERM), it returns an ExitSuccess:
The 143 you get from the shell is synthetic (and nonportable). Signals are
not normal exit codes; WEXITSTATUS is not defined in this case (but often
will be 0, as seems to be shown here), instead WTERMSIG will be set to the
signal that terminated the process. The caller should be using WIFEXITED /
WIFSIGNALED / WIFSTOPPED to determine the cause of the termination and then
the appropriate WEXITSTATUS / WTERMSIG / WSTOPSIG call to determine the
value.
It sounds like the createProcess API does not recognize signal exit at
all, and uses WEXITSTATUS even when it is not valid.
--
brandon s allbery kf8nh sine nomine
associates
allber...@gmail.com
ballb...@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad
http://sinenomine.net
--
Michael Xavier
http://www.michaelxavier.net
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe