The Erlang system is started with the following command:
erl <script-flags> <user-flags>
The executable script erl
is a front-end to the
Erlang runtime system. The flags
for this program are described below.
Windows 95/NT users will probably want to use the werl
program
instead, which uses its own window and supports command-line editing
and has scrollbars.
The erl
program on Windows provides no line editing in its
shell and on Windows 95, there is no scroll back to see text which has
scrolled off the screen.
The erl
program must be used, however, in pipelines or if you want
to redirect standard input or output.
erl <script-flags> <user-flags>
Starts the Erlang system. The erl
script pre-processes some
of the <script-flags>
and passes the
flags to the init
process in the Erlang system. The
<script-flags>
argument is used to initialize the Erlang
kernel processes.
The <user-flags>
argument is also passed to the init
process
and can be accessed through the init
module in the
running system. See init(3).
The following script flags are supported:
Key
configuration parameter of the
AppName
application. See application(3).
File
.boot,
which is used to start the system. See init(3). Unless
File
contains an absolute path, the system searches for File
.boot in the current and <ERL_INSTALL_DIR>/bin
directories .
<ERL_INSTALL_DIR>/bin/start.boot
boot script is used.
<ERL_INSTALL_DIR>/lib
directory. $Var
is expanded
to Directory
in the boot script.
mod1.erl mod2.erl ....
and
then terminate (with non-zero exit code if the compilation of some
file didn't succeed). Implies -noinput
.
Config
.config configuration file in order to
configure the system. See application(3).
$HOME/.erlang.cookie
file when started and
to set the node cookie to the contents of the user's cookie file. If no such
file is found, the system will create one and it will be filled with a
random string. See -setcookie
.
Variable
to the value Value
of the Erlang system. For example:
% erl -env DISPLAY gin:0In this example, an Erlang system is started with the DISPLAY environment variable set to the value
gin:0
.
-loader inet
flag is present. On each host, there must be one Erlang node running,
on which the boot_server
must be started.
Id
must be identical to the name
supplied together with the -sname
or -name
distribution
flags.
instrument
. Functionally, it behaves exactly like
an ordinary Erlang system.
Loader
can be efile
(use the
local file system), or inet
(load using the
boot_server
on another Erlang node). If Loader
is
something else, the user supplied Loader
port program is
started.
-loader
flag is omitted efile
is assumed.
make:all()
in the
current work directory and then terminate. See make(3).
Implies -noinput
.
Module
.
Mode
can be either
interactive
to allow automatic code loading, or
embedded
to load all code during start-up. See code(3).
Name@Host
, where
Host
is the fully qualified host name of the current host.
This option also ensures that epmd
runs on
the current host before Erlang is started.
See epmd(1).
-noshell
.
code server
.
See code(3).
Directories
to the head of the search
path of the code server, as if code:add_pathsa/1
was
called. See code(3).
Directories
to the end of the search
path of the code server, as if code:add_pathsa/1
was
called. See code(3).
-s
flag to the init:boot()
routine.
See init(3).
Cookie
.
As erlang:set_cookie(node(),Cookie)
is used, all
other nodes will also be assumed to have their cookies
set to Cookie
. In this way, several nodes can
share one magic cookie. Erlang magic cookies are explained
in auth(3).
-name
flag, with the exception that
the host name portion of the node name will not be fully qualified.
The following command is used do start Erlang at the host with the name gin.eua.ericsson.se
% erl -sname klacke Eshell V4.7 (abort with ^G) (klacke@gin)1>Only the host name portion of the node name will be relevant. This is sometimes the only way to run distributed Erlang if the DNS (Domain Name System) is not running. There can be no communication between systems running with the
-sname
flag and those running with
the -name
flag, as node names must be unique in distributed
Erlang systems.
xerl
.
All these flags are processed during the start-up of the Erlang
kernel servers and before any user processes are started.
All flags are passed to init:boot(Args)
. See init(3).
All additional flags (<user_flags>
) passed to the script will
be passed to init:boot
as well, and they can be accessed using
the init
module.
The erl
script invokes the code for the Erlang virtual
machine. This program supports the following flags:
size
.
Number
must be
greater than 15 and less than 32769.
size
.
The erl
script must be changed to set or change these flags.
They can also be set directly with the special flag +. For example:
% erl -name foo +B +l
In this example, a distributed node is started with the break handler turned off and a lot of info is displayed while the code is loading.
The special flag --
is used to end the system flags.
The following example is typical for starting a system:
jam47 -- -s mod1 -s mod2 ........
It is not recommendable to run the code for the
Erlang virtual machine directly, or set any of the flags for it
with the special |
init(3), erl_prim_loader(3), erl_boot_server(3), code(3), application(3), heart(3), net_kernel(3), auth(3), make(3), epmd(1)