<div class="gmail_quote">On Sat, Dec 15, 2012 at 3:03 AM, Anders Nygren <span dir="ltr"><<a href="mailto:anders.nygren@gmail.com" target="_blank">anders.nygren@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">On Fri, Dec 14, 2012 at 11:09 AM, Vineet Naik <<a href="mailto:naikvin@gmail.com">naikvin@gmail.com</a>> wrote:<br>
> On Fri, Dec 14, 2012 at 9:39 PM, Daniel Luna <<a href="mailto:daniel@lunas.se">daniel@lunas.se</a>> wrote:<br>
>><br>
>> If this fixed your problem you have missing dependencies in your<br>
>> .app.src file.  We always run {mod_cond, derived} here and it works<br>
>> like a charm.<br>
>><br>
>> Until you miss to add a dependency in the .app.src file that is.<br>
><br>
><br>
> Hi Daniel,<br>
><br>
> I am am not able to exactly understand which dependencies are to be added in<br>
> app.src.<br>
><br>
> My code directly depends upon just two - emysql and exmpp (Not the<br>
> processone version<br>
> but this one [1] which is rebar compatible). Besides these, kernel and<br>
> stdlib are defined.<br>
><br>
> While creating a release on my development machine I could fix some initial<br>
> errors by<br>
> adding inets, sasl and crypto. That solved the problems with mod_cond still<br>
> being 'derived'<br>
><br>
> Today while creating a release on the server (where the app will be deployed<br>
> eventually),<br>
> it again failed with `{"init terminating in do_boot",{'cannot<br>
> load',X,get_file}}` kind of errors<br>
> and adding 'X' to app.src didn't work. Changing mod_cond to 'all' worked.<br>
><br>
> Now if I check the libraries in rel/<release-bundle>/lib directory, there<br>
> are a lot of them<br>
> but not all are added to app.src and it still works.<br>
><br>
> How to decide which ones go in app.src and which don't?<br>
><br>
<br>
</div></div>The ones to put in the .app.src are the applications that MUST be<br>
started* before Your app is started.<br>
This information is used when the .boot script is created, so that all<br>
the applications are started in the correct order.<br>
<br>
*, Yes, I know the documentation says that stdlib shall always be<br>
included even though stdlib doesn't have any processes that needs to<br>
be started.<br></blockquote><div><br></div><div>Ok, now I get it. In fact it's mentioned in LYSE which is one of the resources </div><div>I am referring to.</div><div><br></div><div>From LYSE[1]</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
{mod_cond, all | app | ebin | derived | none}This controls the module inclusion policy. Picking none means no modules will be kept. That's not very useful. The derived option means that Reltool will try to figure out what modules are used by other modules which are already included and add them in that case. Setting the option to app will mean that Reltool keeps all the modules mentioned in the app file and those that were derived. Setting it to ebin will keep those in the ebin/directory and the derived ones. Using the option all will be a mix of using ebin and app. That's the default value.</blockquote>
<div><br></div><div><br></div><div>In the process of desperately trying to get the release working I had </div><div>forgotten of having read this. </div><div><br></div><div>In free time, I will try creating the release from scratch just using reltool </div>
<div>(without rebar). Probably that will make things more clear for me.</div><div><br></div><div>Thanks</div><div><br></div><div>[1] <a href="http://learnyousomeerlang.com/release-is-the-word#releases-with-reltool">http://learnyousomeerlang.com/release-is-the-word#releases-with-reltool</a></div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5"><br>
<br>
> [1]: Rebar compatible fork of exmpp <a href="https://github.com/Zert/exmpp" target="_blank">https://github.com/Zert/exmpp</a><br>
><br>
> Thanks,<br>
> Vineet<br>
><br>
>><br>
>> Cheers,<br>
>><br>
>> Daniel<br>
>><br>
>> On 14 December 2012 09:54, Vineet Naik <<a href="mailto:naikvin@gmail.com">naikvin@gmail.com</a>> wrote:<br>
>> > IRC to the rescue! Changed mod_cond from derived to all<br>
>> > and it solved the problem.<br>
>> ><br>
>> > Thanks a lot<br>
>> > Vineet<br>
>> ><br>
>> ><br>
>> > On Fri, Dec 14, 2012 at 7:11 PM, Vineet Naik <<a href="mailto:naikvin@gmail.com">naikvin@gmail.com</a>> wrote:<br>
>> >><br>
>> >> Now I got past this error, it was a mistake from my side. I didn't<br>
>> >> create<br>
>> >> the node on the server before running generate but copied files from my<br>
>> >> dev machine. After creating node and with some tweaking to the reltool<br>
>> >> config,<br>
>> >> release is generated on the prod server but fails on startup with,<br>
>> >><br>
>> >> {"init terminating in do_boot",{'cannot load',error_handler,get_file}}<br>
>> >><br>
>> >> From erlang docs[1]<br>
>> >><br>
>> >> "Init terminating in do_boot ()" - The primitive Erlang boot sequence<br>
>> >> was<br>
>> >> terminated, most probably because the boot script has errors or cannot<br>
>> >> be<br>
>> >> read. This is usually a configuration error - the system may have been<br>
>> >> started with a faulty -boot parameter or with a boot script from the<br>
>> >> wrong<br>
>> >> version of OTP.<br>
>> >><br>
>> >> How can I check whether boot script running from the wrong version of<br>
>> >> OTP<br>
>> >> is<br>
>> >> the problem?<br>
>> >><br>
>> >> [1]: <a href="http://www.erlang.org/doc/apps/erts/crash_dump.html#id71973" target="_blank">http://www.erlang.org/doc/apps/erts/crash_dump.html#id71973</a><br>
>> >><br>
>> >> Regards,<br>
>> >> Vineet<br>
>> >><br>
>> >> On Fri, Dec 14, 2012 at 4:05 PM, Vineet Naik <<a href="mailto:naikvin@gmail.com">naikvin@gmail.com</a>> wrote:<br>
>> >>><br>
>> >>> Hello,<br>
>> >>><br>
>> >>> Now that I have successfully built a release of my app using rebar, I<br>
>> >>> am<br>
>> >>> stuck at<br>
>> >>> deploying the packaged release because the server I want to deploy to<br>
>> >>> has<br>
>> >>> different<br>
>> >>> version of erlang and different architecture from my development<br>
>> >>> machine.<br>
>> >>><br>
>> >>> Development Env<br>
>> >>> -------------------------<br>
>> >>> i686 i686 i386 GNU/Linux<br>
>> >>> Erlang R14B04<br>
>> >>> erts-5.8.5<br>
>> >>><br>
>> >>> Remote Server<br>
>> >>> ----------------------<br>
>> >>> x86_64 GNU/Linux<br>
>> >>> Erlang R13B03<br>
>> >>> erts-5.7.4<br>
>> >>><br>
>> >>> I tried compiling on the server but it's failing with a series of<br>
>> >>> errors<br>
>> >>> such as<br>
>> >>><br>
>> >>> ERROR: Unable to generate spec: Mandatory application kernel is not<br>
>> >>> included in [{app,crypto,false,undefined,<br>
>> >>><br>
>> >>> "/usr/lib/erlang/lib/crypto-1.6.3",<br>
>> >>><br>
>> >>> ["/usr/lib/erlang/lib/crypto-1.6.3"],<br>
>> >>><br>
>> >>> "1.6.3","crypto-1.6.3",<br>
>> >>>                                                   .....<br>
>> >>><br>
>> >>> I have two questions:<br>
>> >>><br>
>> >>> 1. Is this due to the old version of erlang? And considering that I<br>
>> >>> have<br>
>> >>> ejabberd and rabbitmq-server running in production on the same server<br>
>> >>> can I upgrade erlang to R14B04 on it without having to take them down<br>
>> >>> for<br>
>> >>> much<br>
>> >>> time?<br>
>> >>><br>
>> >>> 2. What is the recommended strategy for developing and deploying<br>
>> >>> erlang<br>
>> >>> code on<br>
>> >>> differently configured servers?<br>
>> >>><br>
>> >>> Thanks,<br>
>> >>> Vineet<br>
>> >>><br>
>> >>><br>
>> >><br>
>> >><br>
>> >><br>
>> >> --<br>
>> >> Vineet Naik<br>
>> >><br>
>> >><br>
>> ><br>
>> ><br>
>> ><br>
>> > --<br>
>> > Vineet Naik<br>
>> ><br>
>> ><br>
>> ><br>
>> > _______________________________________________<br>
>> > erlang-questions mailing list<br>
>> > <a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
>> > <a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
>> ><br>
><br>
><br>
><br>
><br>
> --<br>
> Vineet Naik<br>
><br>
><br>
><br>
> _______________________________________________<br>
> erlang-questions mailing list<br>
> <a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
> <a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Vineet Naik<br><br><br>