[Haskell-cafe] Question about terminateProcess

Niklas Hambüchen mail at nh2.me
Sat Jun 20 02:00:40 UTC 2015



Note: on Windows, if the process was a shell command created by
createProcess with shell, or created by runCommand or
runInteractiveCommand, then terminateProcess will only terminate the
shell, not the command itself. On Unix systems, both processes are in a
process group and will be terminated together.

I don't see that happening, at least not in ghci.

When I do

  import System.Process
  (_,_,_,p) <- createProcess $ (shell "sleep 10")
  -- wait a second or so
  terminateProcess p

in ghci, then in `ps aux | grep "sleep 10"`, the sleep is still running;
same when I'm using `(shell "sleep 10"){ create_group = True }` (`shell`
defaults to `create_group = False`).

What am I missing?

More information about the Haskell-Cafe mailing list