1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
|
.TH config 4 "kernel 2.12.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(4)\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:
.nf
[{Application1, [{Par11, Val11}, \&.\&.]},
\&.\&.
{ApplicationN, [{ParN1, ValN1}, \&.\&.]}]\&.
.fi
.RS 2
.TP 2
*
\fIApplication = atom()\fR is the name of the application\&.
.TP 2
*
\fIPar = atom()\fR is the name of a configuration parameter\&.
.TP 2
*
\fIVal = term()\fR is the value of a configuration parameter\&.
.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:
.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\&.
.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:
.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:
.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(4)\fR, \fIerl(1)\fR, \fIOTP Design Principles\fR
|