用erlang.mk指定应用启动顺序 [英] Specifying app startup order with erlang.mk

查看:138
本文介绍了用erlang.mk指定应用启动顺序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图将一个陈旧的未经维护的构建工具隐藏到erlang.mk。我有一个使用erlang.mk创建的发行版,但在启动时失败,我相信因为应用程序以错误的顺序启动。如何指定应用程序的启动顺序?我会以为它将按照Makefile的LOCAL_DEPS变量中指定的顺序启动应用程序,但似乎并没有发生。我已经看到我可以在文档中加上谷歌,但还没有找到任何东西。

解决方案

订单不依赖于 erlang.mk ,而是在启动应用程序时在Erlang VM本身。当 systools 开始具体应用程序读取 .app 文件,以检查应该预先启动的应用程序并启动它们。只有当所有必备应用程序已成功启动时,才会启动所请求的应用程序。请参阅应用程序的说明文件。



此处的示例

  {application,humbundee,
[{description,Humble Bundle downloader in Erlang},
{vsn,0.0.1},
{modules,
[
= MODULES =
]},
{已注册,[hbd_sup,hbd_get_sup] },
{applications,[kernel,stdlib,sasl,lager]},
{mod,{hbd_app,[]}}
]}。

这表示内核 stdlib sasl lager 必须在 humbundee 可以开始。


I'm trying to covert over from an antiquated unmaintained build tool to erlang.mk. I have a release created using erlang.mk, but it fails when starting up, I believe because apps are starting up in the wrong order. How do I specify the startup order of the apps? I would have thought that it would start up apps in the same order as specified in the LOCAL_DEPS variable of the Makefile, but that doesn't seem to be happening. I've looked everywhere I can in the docs, plus googled, but haven't been able to find anything.

解决方案

The order doesn't depend on erlang.mk but on the Erlang VM itself when it's starting the applications. When systools is starting a specific application it reads the .app file to check which application should have been started beforehand and starts them. Only when all the prerequisite applications have been started successfully the requested application is started. See the description of the app file.

Example from here:

{application, humbundee,
 [{description, "Humble Bundle downloader written in Erlang"},
  {vsn, "0.0.1"},
  {modules,
   [
    =MODULES=
   ]},
  {registered, [hbd_sup, hbd_get_sup]},
  {applications, [kernel, stdlib, sasl, lager]},
  {mod, {hbd_app, []}}
 ]}.

This says that kernel, stdlib, sasl, and lager must be started before humbundee could be started.

这篇关于用erlang.mk指定应用启动顺序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆