Specifying app startup order with erlang.mk

杀马特。学长 韩版系。学妹 提交于 2020-01-16 00:44:31

问题


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.


回答1:


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.




回答2:


It is based on .app file applications list. Each application and its dependents are started before continuing to the next one.



来源:https://stackoverflow.com/questions/36165942/specifying-app-startup-order-with-erlang-mk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!