My problem is actually around exec.CommandContext. I mentioned 
os.Process.Kill is because that's the interface that exec.CommandContext 
uses <https://golang.org/pkg/os/exec/#CommandContext>:

> The provided context is used to kill the process (by calling 
os.Process.Kill) if the context becomes done before the command completes 
on its own.

It would be fine to change only exec.CommandContext to do the right thing: 
*if* the process was started with Setsid, *and* we're running on Unix, then 
call unix.Kill with negative pid - otherwise fall back to os.Process.Kill.  
Would that be reasonable?

Alternatively, could you provide a hook for a user-defined killing function?

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/7a8fd05b-036f-4813-9538-1ebd6b02f8dbo%40googlegroups.com.

Reply via email to