erlang - startup script -
To start my program, I do the next sequence:
$ erl & Gt; C (module1) & Gt; C (module2) & Gt; C (modulen) Modulen: start ().
Is there any possibility of creating a script that permits me to launch my program?
You can use a loader script which will be the focus of starting your application in OTP fashion. Contains:
-module (XYZ_app). Export ([Start / 0]). Start () - & gt; Application: Start (inets), Application: Start (XYZ).
You launch that script through a shell script. Be careful about using escript
, if you plan to run running daemons at OS boot time, because they are difficult.
#! / Bin / bash erl -boot start_sasl -s > [{description, "tinyecch"}, {world, "0.1"}, {module, [tinniechouch, tinniechouch_ app, tinkach_app, tunicch_servar, tinycock_logger_h, teechouch_utils, tinnouchch_db, mode_tinacache) }, {Registered, [tinicoch, tinkacha server, technic_app]}, {application, [kernel, stadilib, sassel, inset]}, {env, []}, %% application start point {mod, {tinycouch_sup, []}} ]}.
... and all your .erl
files should be compiled.
Note If you intend to distribute your app (such as Debian repositories, etc.), you may create your app for compiling and installing
file should be considered.
As the last note: You can also go with a boot
file (in the last OTP manner), but I get very much the hurdle: Boot file Errang (and The Specific version of the other dependent applications relates to your application for release. Your application may be able to run in various Erlang releases, but you will need a separate build / release process for each "platform release" that you want to ship for it.
Comments
Post a Comment