Stop Erlang Daemon
Bes开发者_运维问答ides running $ killall -9 beam.smp
, how can I kill an Erlang node programmatically when I know its -sname
?
If I don't want the heartbeat monitor to restart the process, how can I ensure that whatever answer is given for the above question will also kill the heartbeat?
Is there a decent guide to deploying Erlang as a daemon?
kill
and killall
with -9
is almost always wrong.
You can quite easily ask the remote node to exit using:
rpc:call(RemoteNode, init, stop, []).
I don't know whether that'd prevent heart
from restarting it, but I'd suggest that if you expect to stop it, you shouldn't run it in a don't-ever-stop mode.
Update - Zed points out that init:stop
does the right thing with heart
, so the above rpc:call
is the best and only way to do it.
精彩评论