Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I kill a process in Erlang knowing only the module name used to start it?

Tags:

erlang

How do I kill a process in Erlang knowing only the module name used to start it?

like image 370
yazz.com Avatar asked Feb 21 '10 18:02

yazz.com


2 Answers

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).

like image 58
RichardC Avatar answered Nov 04 '22 19:11

RichardC


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.

like image 24
Zed Avatar answered Nov 04 '22 19:11

Zed