[erlang-questions] HEART

Tristan Sloughter <>
Tue May 12 19:34:33 CEST 2015


The start script generated using rebar should also have a getpid
supported argument and a start that works the same. The scripts between
relx and rebar are nearly identical.

But I'd still suggest moving to relx over reltool :)

--
Tristan Sloughter 



On Tue, May 12, 2015, at 12:29 PM, Roberto Ostinelli wrote:
> Indeed, I'm usong rebar (not relx, not rebar3). AFAIK this option is a
> relx option unfortunately.
>
> Is is worthy to move to relx for this?
>
>
>
> On 12/mag/2015, at 18:58, Tristan Sloughter <> wrote:
>
>> I'd suggest relx (github.com/erlware/relx) or rebar3 which use relx
>> http://www.rebar3.org/v3.0/docs/releases
>>
>> I've never had to do what you are trying to do but I know the
>> extended_start_script has the ability to return the pid of the
>> running node and `start` uses `run_erl` for running as a daemon and
>> allows attaching through a fifo pipe.
>>
>> It would be great to improve the generated release scripts and
>> whatever else we can to make this easier.
>>
>> --
>> Tristan Sloughter 
>>
>>
>>
>> On Tue, May 12, 2015, at 11:48 AM, Dmitry Kolesnikov wrote:
>>> Hello Roberto,
>>>
>>> The rebar makes a dirty work to generate "node release” and
>>> necessary bootstrap scripts. Please check create-node command and
>>> concept of erlang releases:
>>> https://github.com/rebar/rebar/wiki/Rebar-commands
>>> http://www.erlang.org/doc/man/reltool.html
>>>
>>> It generates script looks something similar to this one. It also
>>> hooks the heart to watchdog the node.
>>> https://github.com/fogfish/hyperion/blob/master/rel/files/hyperion
>>>
>>> Personally, I am following an idea to package the application to
>>> release and ship it to destination hosts. Long time ago, I’ve made
>>> an empty “erlang release” project as show-case to study and debug
>>> various scenarios. You might look on it here:
>>>
>>> https://github.com/fogfish/hyperion
>>>
>>> Best Regards, Dmitry
>>>
>>>
>>>> On 12 May 2015, at 19:07, Roberto Ostinelli <>
>>>> wrote:
>>>>
>>>> Fair enough, however at this point I cannot even a single one of
>>>> these systems to simply START *and* STOP an Erlang release. I can
>>>> easily start it (on ubuntu, `sudo service myapp start`) but the
>>>> STOP command will always fail. That's because the init script
>>>> cannot get a grasp of the BEAM process' pid (for some reason),
>>>> hence it cannot stop it.
>>>>
>>>> Any ideas on how to do that?
>>>>
>>>>
>>>> On Tue, May 12, 2015 at 5:52 PM, Jesper Louis Andersen
>>>> <> wrote:
>>>>>
>>>>>
>>>>> On Mon, May 11, 2015 at 9:13 PM, Roberto Ostinelli
>>>>> <> wrote:
>>>>>
>>>>>> In non-erlang systems, I would have standard watchdogs that
>>>>>> launch an application on OS boot, and then monitor it and
>>>>>> relaunch it if necessary.
>>>>>
>>>>> The heart system in Erlang is a simple watchdog, mostly used if
>>>>> you nothing else that will restart your application. In an SysV
>>>>> init system, there is no automatic watching and restart. In RcNG
>>>>> in FreeBSD, there is no restart. In OpenBSDs rc, there is no
>>>>> automatic restart.
>>>>>
>>>>> But as you say, many modern init systems also provides watching of
>>>>> the applications it starts, and in that case I wouldn't run with
>>>>> heart enabled. Better to let the system above handle it, and plug
>>>>> into its monitoring/reporting and so on.
>>>>>
>>>>> Heart is very useful if you start nodes outside the control of the
>>>>> system watchdog though. In that case, they won't be restarted, and
>>>>> you can run heart on those.
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>>
>>>>> J.
>>>>>
>>>>
>>>> _______________________________________________
>>>> erlang-questions mailing list 
>>>> http://erlang.org/mailman/listinfo/erlang-questions
>>>
>>> _________________________________________________
>>> erlang-questions mailing list 
>>> http://erlang.org/mailman/listinfo/erlang-questions
>>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20150512/0fc6a078/attachment.html>


More information about the erlang-questions mailing list