.TH config 5 "kernel 3.0.3" "Ericsson AB" "Files" .SH NAME config \- Configuration file. .SH DESCRIPTION .LP A \fIconfiguration file\fR\& contains values for configuration parameters for the applications in the system\&. The \fIerl\fR\& command line argument \fI-config Name\fR\& tells the system to use data in the system configuration file \fIName\&.config\fR\&\&. .LP Configuration parameter values in the configuration file will override the values in the application resource files (see \fIapp(5)\fR\&)\&. The values in the configuration file can be overridden by command line flags (see \fIerl(1)\fR\&)\&. .LP The value of a configuration parameter is retrieved by calling \fIapplication:get_env/1,2\fR\&\&. .SH "FILE SYNTAX" .LP The configuration file should be called \fIName\&.config\fR\& where \fIName\fR\& is an arbitrary name\&. .LP The \fI\&.config\fR\& file contains one single Erlang term\&. The file has the following syntax: .LP .nf [{Application1, [{Par11, Val11}, ..]}, .. {ApplicationN, [{ParN1, ValN1}, ..]}]. .fi .RS 2 .TP 2 * \fIApplication = atom()\fR\& is the name of the application\&. .LP .TP 2 * \fIPar = atom()\fR\& is the name of a configuration parameter\&. .LP .TP 2 * \fIVal = term()\fR\& is the value of a configuration parameter\&. .LP .RE .SH "SYS.CONFIG" .LP When starting Erlang in embedded mode, it is assumed that exactly one system configuration file is used, named \fIsys\&.config\fR\&\&. This file should be located in \fI$ROOT/releases/Vsn\fR\&, where \fI$ROOT\fR\& is the Erlang/OTP root installation directory and \fIVsn\fR\& is the release version\&. .LP Release handling relies on this assumption\&. When installing a new release version, the new \fIsys\&.config\fR\& is read and used to update the application configurations\&. .LP This means that specifying another, or additional, \fI\&.config\fR\& files would lead to inconsistent update of application configurations\&. Therefore, in Erlang 5\&.4/OTP R10B, the syntax of \fIsys\&.config\fR\& was extended to allow pointing out other \fI\&.config\fR\& files: .LP .nf [{Application, [{Par, Val}]} | File]. .fi .RS 2 .TP 2 * \fIFile = string()\fR\& is the name of another \fI\&.config\fR\& file\&. The extension \fI\&.config\fR\& may be omitted\&. It is recommended to use absolute paths\&. A relative path is relative the current working directory of the emulator\&. .LP .RE .LP When traversing the contents of \fIsys\&.config\fR\& and a filename is encountered, its contents are read and merged with the result so far\&. When an application configuration tuple \fI{Application, Env}\fR\& is found, it is merged with the result so far\&. Merging means that new parameters are added and existing parameter values overwritten\&. Example: .LP .nf sys.config: [{myapp,[{par1,val1},{par2,val2}]}, "/home/user/myconfig"]. myconfig.config: [{myapp,[{par2,val3},{par3,val4}]}]. .fi .LP This will yield the following environment for \fImyapp\fR\&: .LP .nf [{par1,val1},{par2,val3},{par3,val4}] .fi .LP The behaviour if a file specified in \fIsys\&.config\fR\& does not exist or is erroneous in some other way, is backwards compatible\&. Starting the runtime system will fail\&. Installing a new release version will not fail, but an error message is given and the erroneous file is ignored\&. .SH "SEE ALSO" .LP \fIapp(5)\fR\&, \fIerl(1)\fR\&, \fIOTP Design Principles\fR\&