Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
application starting in releases
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Roberto Ostinelli  
View profile  
 More options Oct 14 2012, 5:29 pm
From: Roberto Ostinelli <robe...@widetag.com>
Date: Sun, 14 Oct 2012 14:29:48 -0700
Local: Sun, Oct 14 2012 5:29 pm
Subject: [erlang-questions] application starting in releases

Dear list,

AFAIK a release will start the dependency applications defined in an
application .app file. So for instance, if I specify:

{application, myapp, [
{description, ""},
{vsn, "0.1-dev"},
{modules, []},
{registered, [
]},
{applications, [
kernel,
stdlib,
compiler,
syntax_tools,
lager
]},
{mod, {myapp, []}},
{env, []}
]}.

When I package all of this as a release, all of the specified applications
will be started automatically when I launch myapp. Is this correct?

If so, I want to have a developer start script that starts these
applications manually, to emulate what the release will launch for me: I do
not want to have extra application:start(compiler) code in myapp, since I
won't need that once it's packaged.

So I'm using this:

erl -pa apps/*/ebin -pa deps/*/ebin \
-boot start_sasl \
-config app \
-s application start compiler
-s myapp

However compiler does not start:

1> application:which_applications().
[{sasl,"SASL  CXC 138 11","2.2.1"},
 {stdlib,"ERTS  CXC 138 10","1.18.2"},
 {kernel,"ERTS  CXC 138 10","2.15.2"}]

But if I manually start it:

2> application:start(compiler).
ok

Is there something I'm doing wrong? Am I actually supposed to use
application:start/1 in myapp anyways?

Thank you,

r.

_______________________________________________
erlang-questions mailing list
erlang-questi...@erlang.org
http://erlang.org/mailman/listinfo/erlang-questions


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
fr...@circlewave.net  
View profile  
 More options Oct 14 2012, 6:07 pm
From: fr...@circlewave.net
Date: Sun, 14 Oct 2012 17:45:26 -0400
Local: Sun, Oct 14 2012 5:45 pm
Subject: Re: [erlang-questions] application starting in releases

On Sun, Oct 14, 2012 at 02:29:48PM -0700, Roberto Ostinelli wrote:
> If so, I want to have a developer start script that starts these
> applications manually, to emulate what the release will launch for me: I do
> not want to have extra application:start(compiler) code in myapp, since I
> won't need that once it's packaged.

> So I'm using this:

> erl -pa apps/*/ebin -pa deps/*/ebin \
> -boot start_sasl \
> -config app \
> -s application start compiler

This ends up doing "application:start([compiler])" which returns an error,
init(3) probably ignores return value as it couldn't really know what to
expect. Try with -eval instead:

  erl -boot start_sasl -eval 'application:start(compiler).'

BTW I vaguely recall rebar can do this for you somehow?

> Am I actually supposed to use application:start/1 in myapp anyways?

No, it's quite rare to do that, the only use case I've seen is bringing
protocol stacks up and down manually depending on availability of some
backend connections (well, lazy man's way to do that anyway).

BR,
        -- Jachym
_______________________________________________
erlang-questions mailing list
erlang-questi...@erlang.org
http://erlang.org/mailman/listinfo/erlang-questions


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Roberto Ostinelli  
View profile  
 More options Oct 14 2012, 7:02 pm
From: Roberto Ostinelli <robe...@widetag.com>
Date: Sun, 14 Oct 2012 15:57:17 -0700
Local: Sun, Oct 14 2012 6:57 pm
Subject: Re: [erlang-questions] application starting in releases

This ends up doing "application:start([compiler])" which returns an error,

> init(3) probably ignores return value as it couldn't really know what to
> expect. Try with -eval instead:

>   erl -boot start_sasl -eval 'application:start(compiler).'

Oh I see. I wanted to avoid `eval` for some reason, but this works
perfectly. Thank you.

BTW I vaguely recall rebar can do this for you somehow?

No idea. Tuncer? :)

> Am I actually supposed to use application:start/1 in myapp anyways?

> No, it's quite rare to do that, the only use case I've seen is bringing
> protocol stacks up and down manually depending on availability of some
> backend connections (well, lazy man's way to do that anyway).

Ok this is exactly what I thought.

Again, thank you,

r.

_______________________________________________
erlang-questions mailing list
erlang-questi...@erlang.org
http://erlang.org/mailman/listinfo/erlang-questions


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tuncer Ayaz  
View profile  
 More options Oct 15 2012, 4:20 pm
From: Tuncer Ayaz <tuncer.a...@gmail.com>
Date: Mon, 15 Oct 2012 22:19:35 +0200
Local: Mon, Oct 15 2012 4:19 pm
Subject: Re: [erlang-questions] application starting in releases

This is most likely referring to the release support and
scripts/templates.

> > > Am I actually supposed to use application:start/1 in myapp
> > > anyways?

> > No, it's quite rare to do that, the only use case I've seen is
> > bringing protocol stacks up and down manually depending on
> > availability of some backend connections (well, lazy man's way to
> > do that anyway).

> Ok this is exactly what I thought.

> Again, thank you,

_______________________________________________
erlang-questions mailing list
erlang-questi...@erlang.org
http://erlang.org/mailman/listinfo/erlang-questions

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »