[erlang-questions] How do you kill an OS process that was opened with open_port on a brutal_kill?
Per Hedeland
per@REDACTED
Fri Nov 25 20:38:00 CET 2016
On 2016-11-25 18:17, Vans S wrote:
> Per Hedeland and José Valim that method works great. One small peeve is it makes an extra process
Yes, but that shouldn't be any actual cost beyond a comparitively small
amount of memory (that can be mostly paged out even if you don't have
swap) - it doesn't actually *do* anything, just sits in a blocking
read(2) of its stdin.
> but the only way around this would be to patch the OS Processes code to terminate when stdin closes.
Assuming that you mean modifying the "target" program, yes - this would
be the "best" solution, but there are many cases where it is problematic
- obviously if you don't actually have the source code, but even if you
do, the modification can be non-trivial in a complex program, and it's a
pain to keep modifying the code and running the modified version when
new versions are released, etc.
> For now using the shell script is more then enough.
Great!
--Per
More information about the erlang-questions
mailing list