[erlang-questions] suggestions on how to start an erlang application from os shell script

Michael McDaniel <>
Tue May 5 19:13:32 CEST 2009


here's my directory structure ...

  myapp/
     Makefile  /doc   /ebin   /include   /priv    /src
                                          /conf     start_myapp.rel


here could be the contents of start_myapp.rel in the src
directory


{release, {"OTP  APN 181 01","R13B"}, {erts, "5.6"},
 [  {kernel,"2.13.1"}
  , {stdlib,"1.16.1"}
  , {sasl,"2.1.6"}
  , {mnesia,"4.4.9"}
  , {os_mon,"2.2.1"}
  , {ssl,"3.10.1"}
  , {myapp, "1.1"}
 ]
}.


Here is a snippet from my Makefile for myapp ...

erl  -pa ebin  -s systools make_script src/start_myapp  -s init stop


after running systools:make_script/2, start_myapp.script and
start_myapp.boot are in the ebin directory and then the startup
line uses

   -boot ebin/start_myapp

(if started from myapp/  directory)


More details in the documentation.

   
~M


On Tue, May 05, 2009 at 09:29:02AM -0600, Mark Geib wrote:
> I have created an erlang application using the OTP structure.
> 
> During development I have been doing
> erl -boot start_sasl ... then
> application:start(myapp).
> 
> Now I am ready to package and deploy the app. We use debian systems here 
> so I need to build a debian package to deploy from. The problem is I 
> have not found a good way to start the app from the command line, i.e. a 
> os shell script. I have tried creating a boot script, but this seems to 
> require hard coded versions of the required apps, like kernel, sasl, 
> etc. However we have various versions of debian in production with 
> slightly different version of erlang, etc. installed. So I don't know 
> the target environment.
> 
> I could create a one line erlang program that does 
> application:start(myapp), but this seems unnecessary.
> 
> So, what is the standard method for starting a application from the 
> command line.
> 
> Thanks,
> Mark.
> 
> -- 
> Principal Engineer
> Cheyenne Software Engineering
>  / 35-215
> 
> _______________________________________________
> erlang-questions mailing list
> 
> http://www.erlang.org/mailman/listinfo/erlang-questions

-- 
Michael McDaniel
Portland, Oregon, USA
http://autosys.us



More information about the erlang-questions mailing list