[erlang-questions] application starting in releases

freza@REDACTED freza@REDACTED
Sun Oct 14 23:45:26 CEST 2012


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



More information about the erlang-questions mailing list