.TH script 5 "sasl 3.0.2" "Ericsson AB" "Files" .SH NAME script \- Boot script .SH DESCRIPTION .LP The \fIboot script\fR\& describes how the Erlang runtime system is started\&. It contains instructions on which code to load and which processes and applications to start\&. .LP Command \fIerl -boot Name\fR\& starts the system with a boot file called \fIName\&.boot\fR\&, which is generated from the \fIName\&.script\fR\& file, using \fB\fIsystools:script2boot/1\fR\&\fR\&\&. .LP The \fI\&.script\fR\& file is generated by \fIsystools\fR\& from a \fI\&.rel\fR\& file and from \fI\&.app\fR\& files\&. .SH "FILE SYNTAX" .LP The boot script is stored in a file with extension \fI\&.script\fR\&\&. The file has the following syntax: .LP .nf {script, {Name, Vsn}, [ {progress, loading}, {preLoaded, [Mod1, Mod2, ...]}, {path, [Dir1,"$ROOT/Dir",...]}. {primLoad, [Mod1, Mod2, ...]}, ... {kernel_load_completed}, {progress, loaded}, {kernelProcess, Name, {Mod, Func, Args}}, ... {apply, {Mod, Func, Args}}, ... {progress, started}]}. .fi .RS 2 .TP 2 .B \fIName = string()\fR\&: Defines the system name\&. .TP 2 .B \fIVsn = string()\fR\&: Defines the system version\&. .TP 2 .B \fI{progress, Term}\fR\&: Sets the "progress" of the initialization program\&. The \fB\fIinit:get_status/0\fR\&\fR\& function returns the current value of the progress, which is \fI{InternalStatus,Term}\fR\&\&. .TP 2 .B \fI{path, [Dir]}\fR\&: \fIDir\fR\& is a string\&. This argument sets the load path of the system to \fI[Dir]\fR\&\&. The load path used to load modules is obtained from the initial load path, which is given in the script file, together with any path flags that were supplied in the command-line arguments\&. The command-line arguments modify the path as follows: .RS 2 .TP 2 * \fI-pa Dir1 Dir2 \&.\&.\&. DirN\fR\& adds the directories \fIDirN, DirN-1, \&.\&.\&., Dir2, Dir1\fR\& to the front of the initial load path\&. .LP .TP 2 * \fI-pz Dir1 Dir2 \&.\&.\&. DirN\fR\& adds the directories \fIDir1, Dir2, \&.\&.\&., DirN\fR\& to the end of the initial load path\&. .LP .TP 2 * \fI-path Dir1 Dir2 \&.\&.\&. DirN\fR\& defines a set of directories \fIDir1, Dir2, \&.\&.\&., DirN\fR\&, which replace the search path given in the script file\&. Directory names in the path are interpreted as follows: .RS 2 .TP 2 * Directory names starting with \fI/\fR\& are assumed to be absolute path names\&. .LP .TP 2 * Directory names not starting with \fI/\fR\& are assumed to be relative the current working directory\&. .LP .TP 2 * The special \fI$ROOT\fR\& variable can only be used in the script, not as a command-line argument\&. The given directory is relative the Erlang installation directory\&. .LP .RE .LP .RE .TP 2 .B \fI{primLoad, [Mod]}\fR\&: Loads the modules \fI[Mod]\fR\& from the directories specified in \fIPath\fR\&\&. The script interpreter fetches the appropriate module by calling \fB\fIerl_prim_loader:get_file(Mod)\fR\&\fR\&\&. A fatal error that terminates the system occurs if the module cannot be located\&. .TP 2 .B \fI{kernel_load_completed}\fR\&: Indicates that all modules that \fImust\fR\& be loaded \fIbefore\fR\& any processes are started are loaded\&. In interactive mode, all \fI{primLoad,[Mod]}\fR\& commands interpreted after this command are ignored, and these modules are loaded on demand\&. In embedded mode, \fIkernel_load_completed\fR\& is ignored, and all modules are loaded during system start\&. .TP 2 .B \fI{kernelProcess, Name, {Mod, Func, Args}}\fR\&: Starts the "kernel process" \fIName\fR\& by evaluating \fIapply(Mod, Func, Args)\fR\&\&. The start function is to return \fI{ok, Pid}\fR\& or \fIignore\fR\&\&. The \fIinit\fR\& process monitors the behavior of \fIPid\fR\& and terminates the system if \fIPid\fR\& dies\&. Kernel processes are key components of the runtime system\&. Users do not normally add new kernel processes\&. .TP 2 .B \fI{apply, {Mod, Func, Args}}\fR\&\&.: The init process evaluates \fIapply(Mod, Func, Args)\fR\&\&. The system terminates if this results in an error\&. The boot procedure hangs if this function never returns\&. .RE .LP .RS -4 .B Note: .RE In an interactive system, the code loader provides demand-driven code loading, but in an embedded system the code loader loads all code immediately\&. The same version of \fB\fIcode\fR\&\fR\& is used in both cases\&. The code server calls \fB\fIinit:get_argument(mode)\fR\&\fR\& to determine if it is to run in demand mode or non-demand driven mode\&. .SH "SEE ALSO" .LP \fB\fIsystools(3erl)\fR\&\fR\&