YAWS Embedded作为rebar3问题中的依赖项 [英] YAWS Embedded as dependence in rebar3 issue

查看:65
本文介绍了YAWS Embedded作为rebar3问题中的依赖项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在嵌入式模式下的应用程序(如dep)中使用YAWS.我正在使用rebar3.我的应用程序以dep& amp;的方式显示偏航通过rebar3(经过一些调整)构建&发布很好,但是当我启动它时,YAWS崩溃了.看起来它即使在嵌入式模式下也试图启动.

I'm trying to use YAWS in an application (as dep) in embedded mode. I'm using rebar3. My application gets yaws as dep & builds via rebar3 (after some tweaking) & releases fine, but when I launch it YAWS is crashing out. It appears it is trying to start up even through it should be in embedded mode.

我正尝试将yaws.app.src配置为嵌入式环境env,如下所示:

I'm attempting to configured the yaws.app.src into embedded mode env as follows:

{application,yaws,
 [{description,"yaws WWW server"},
  {vsn, {cmd, "sed -ne '1,/^YAWS_VSN=/s/^YAWS_VSN=//p' vsn.mk 2>/dev/null"}},
  {modules,[]},
  {registered, []},
  {mod,{yaws_app,[]}},
  {env, [
           {embedded, true}             % true | false
        ]},
  {applications,[kernel,stdlib@APPDEPS@]}]}.

我认为它是自动启动的,因为它在我的app.src文件中被列为应用程序.(但是不确定)如果我从这里删除,我将不会获得针对YAW的发行文件.但是启动后,它正在寻找配置文件,而不像嵌入式模式那样运行.

I think it is starting automatically since it is listed as an application in my app.src file. (Not sure though) If I remove from here I don't get files in release for YAWs. But when launched it is looking for config file and not acting like in embedded mode.

=INFO REPORT==== 2-Sep-2015::19:00:58 ===
Yaws: Using config file /Users/someuser/csvp/_build/default/lib/yaws/etc/yaws/yaws.conf

我想念什么?为什么它仍在启动以及为什么使用配置文件?

What am I missing?? Why is it still launching and why it is using the config file?

推荐答案

我怀疑您指定的是Yaws应该在发行版开始时启动,与发行版中的其他应用程序相同.基本上,这等效于调用 application:start(yaws).相反,您应该做的是加载Yaws但不启动它-等效于 application:load(yaws)—我相信您可以通过在 rebar.config 文件的relx部分中指定 {yaws,load} 来实现.然后,您应该遵循Yaws文档中的这些说明,在在您自己的主管下开始".部分.根据您的特定需求,您可以调用 yaws_api:embedded_start_conf/1,2,3,4 之一来获取Yaws服务器conf,全局conf和子级规范.然后,您将使用子规范在主管下启动Yaws,如使用Embedded_start_conf"中所述,然后设置Yaws配置服务器confs和global conf使其运行.

I suspect that you're specifying that Yaws should start up when the release starts, same as other applications in the release; basically, the equivalent of calling application:start(yaws). What you should be doing instead is loading Yaws but not starting it — the equivalent of application:load(yaws) — which I believe you can do by specifying {yaws, load} in the relx section of your rebar.config file. You should then follow these instructions in the Yaws documentation under the "Starting under your own supervisor" section. Depending on your specific needs, you'd call one of the yaws_api:embedded_start_conf/1,2,3,4 to get the Yaws server confs, global conf, and child specs. You'd then use the child specs to start Yaws under your supervisors, as explained under "Using embedded_start_conf", and then set the Yaws configuration server confs and global conf to get it running.

这篇关于YAWS Embedded作为rebar3问题中的依赖项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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