How do I kill a process in Erlang knowing only the module name used to start it?
If it's for simple debugging, you could run pman:start(), and just look for the process (double-click on an entry to see details such as initial call). You can then kill it from pman directly.
Otherwise, you could use erlang:processes() to list all processes in the system (horrible, I know), and run erlang:process_info(Pid, initial_call) on each of them to find the right process. Once you've done that, just use exit(Pid, kill).
There is no way to do that.
Your best bet is to speculate based on the the registered name and/or the initial call of your processes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With