¿Hay alguna forma de eliminar erlang vm cuando se ejecuta con -heart?

The title pretty much sums it up. I have a zotonic site running with -heart, it uses lots of cpu time and I can't get an erlang shell. So, is there a way to kill the vm? killall heart y killall beam.smp no están funcionando.

Encontré esta pregunta: Detener Erlang Daemon , but it does not really answer my question.

preguntado el 27 de agosto de 11 a las 22:08

In my experience first killing heart followed by killing beam or beam.smp does the trick. -

@Steve I did try that without success. I have since found the problem of not being able to get a shell, namely this: groups.google.com/group/zotonic-users/browse_thread/thread/…. So I solved this by solving the underlying issue it seems :). Still, I think how to do this should be better documented (somewhere). -

Kill heart and then beam, in one command line. Always works for me. We (the Zotonic team) are looking at non-heart solutions. -

For anyone who stumbles across this: I much prefer supervisord to heart - it's behavior is more easily customizable and it works for non-erlang things, meaning as you learn its nuances those learnings are more applicable. -

3 Respuestas

Solo usa:

init:stop().

It will kill the heart process and all applications.

Respondido 29 ago 11, 22:08

But he said he can't get an Erlang shell, because the process is using too much CPU, so I don't think this helps in this particular case. - Steve Vinoski

When I tried this from remsh, heart didn't die and it restarted the remsh node and the original node. - Michael Terry

I had this same issue.... And it was really hard to kill it. I tried the normal paths and couldn't do it. So I did this hack:

First let's get the PID

sudo netstat -tulpn |grep 8080
tcp        0      0 0.0.0.0:8080            0.0.0.0:*               LISTEN      931/beam.smp    

So the PID is 931.

Next which program created that process?

lsof -p 931 | grep txt
lsof: WARNING: can't stat() fuse.gvfs-fuse-daemon file system /home/agarcia/.gvfs
      Output information may be incomplete.
beam.smp 931 yaws  txt    REG     8,1  2053256 22793377 /usr/lib/erlang/erts-5.8.5/bin/beam.smp

So the program is .../bin/beam.smp so just move it

mv beam.smp old_beam.smp 

And now you kill it

kill -9 931

And I finally was able to kill it :-)

It's a testament to erlangs reliability that one actually needs to hack-it in order to be able to take down the service.

ps: I originally tried yaws -I [pid] --stop but it didn't work either.

Respondido 07 Feb 13, 03:02

If you don't mind killing every VM on your machine:

ps aux | grep -e heart -e epmd | grep -v grep | tr -s ' ' | cut -d ' ' -f 2 | xargs kill -9

The VM and heart seem to monitor each other mutually. In case the VM is in a crash/revive loop, you may need to run this command several times quickly to kill everything dead.

Respondido 05 Jul 18, 07:07

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.