3

I start my release with a script:

#!/bin/bash
ERL_FLAGS=" -args_file config/vm.args -config config/sys.config" rebar3 shell

I have a -heart command in my vm.args file because I want the node to boot automatically after it crashes, using the script. For manual node crash, I use the command "kill -SEGV pid", and kill the heart_beat_kill_pid. after that, I got a message :

segmentation fault (core dumped) ERL_FLAGS=" -args_file config/vm.args -config config/sys.config" rebar3 shell
heart: Erlang has closed.
heart: Would reboot. Terminating.

and nothing happens.

I think that I don't understand enough about the -heart flag. What do I need to do to deal with the problem of the crashed node?

ersa
  • 81
  • 7

1 Answers1

1

As per the documentation in https://erlang.org/doc/man/heart.html, HEART_COMMAND environment variable needs to set for the node to restart automatically after crash.

Also, as you seem to be using rebar3, I would recommend setting {extended_start_script, true} in rebar.config (relx properties). This would generate a nice start script that can be used to start the erlang node as a daemon process.

  • I did set HEART_COMMAND = ./script.sh , the results were as above(segmentation fault). The command: ```ERL_FLAGS=" -args_file config/vm.args -config config/sys.config" rebar3 shell Extended_start_script is true, where is the script located? – ersa Jul 26 '20 at 16:28
  • I cannot edit the previous message, this is an edit: I did set HEART_COMMAND = ./script.sh , the results were as above(segmentation fault). The command: ``` ERL_FLAGS=" -args_file config/vm.args -config config/sys.config" rebar3 shell ``` start the node, I think for HEART_COMMAND I need erlang commands, that's true? if yes, that's my problem. Extended_start_script is true, where is the script located? – ersa Jul 26 '20 at 16:35
  • the startup script is generated when you build a release `rebar3 release`. It will be in `_build/default/rel//bin/` directory. – Venkatakumar Srinivasan Jul 26 '20 at 20:33