[erlang-questions] How to kill a process started with open_port({spawn_executable, ... ?

Paul Davis paul.joseph.davis@REDACTED
Thu Aug 25 17:51:52 CEST 2011


I'm not sure if this is the cleanest approach or not, but in CouchDB
we place a shim between Erlang and the OS process that reports a cmd
that can be passed to os:cmd to execute the process. There's a version
for both Unix and Windows.

The Unix version in its entirety (minus the license):

    #! /bin/sh -e
    echo "kill -9 $$"
    exec $*

https://github.com/apache/couchdb/tree/trunk/src/couchdb/priv/spawnkillable

On Thu, Aug 25, 2011 at 10:43 AM, Robert Raschke
<rtrlists@REDACTED> wrote:
> Hi,
>
> is it possible to explicitly kill an OS process that's been started with and
> open_port({spawn_executable, "executable"}, ...) call from within Erlang?
>
> This is on Windows for me just now, in case there is a way and it differs
> between OSes.
>
> Thanks,
> Robby
>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
>



More information about the erlang-questions mailing list