1config(5)                            Files                           config(5)
2
3
4

NAME

6       config - Configuration file.
7

DESCRIPTION

9       A  configuration  file contains values for configuration parameters for
10       the applications in the system. The erl command-line  argument  -config
11       Name  tells  the  system  to  use data in the system configuration file
12       Name.config.
13
14       Configuration parameter values in the configuration file  override  the
15       values in the application resource files (see app(4). The values in the
16       configuration  file  can  be  overridden  by  command-line  flags  (see
17       erts:erl(1).
18
19       The value of a configuration parameter is retrieved by calling applica‐
20       tion:get_env/1,2.
21

FILE SYNTAX

23       The configuration file is to be called Name.config, where Name  is  any
24       name.
25
26       File  .config  contains a single Erlang term and has the following syn‐
27       tax:
28
29       [{Application1, [{Par11, Val11}, ...]},
30        ...
31        {ApplicationN, [{ParN1, ValN1}, ...]}].
32
33         Application = atom():
34           Application name.
35
36         Par = atom():
37           Name of a configuration parameter.
38
39         Val = term():
40           Value of a configuration parameter.
41

SYS.CONFIG

43       When starting Erlang in embedded mode, it is assumed that  exactly  one
44       system configuration file is used, named sys.config. This file is to be
45       located in $ROOT/releases/Vsn,  where  $ROOT  is  the  Erlang/OTP  root
46       installation directory and Vsn is the release version.
47
48       Release  handling  relies  on  this  assumption.  When installing a new
49       release version, the new sys.config is read  and  used  to  update  the
50       application configurations.
51
52       This means that specifying another .config file, or more .config files,
53       leads to inconsistent update of application configurations.  There  is,
54       however, a syntax for sys.config that allows pointing out other .config
55       files:
56
57       [{Application, [{Par, Val}]} | File].
58
59         File = string():
60           Name of another .config file. Extension .config can be omitted.  It
61           is  recommended  to use absolute paths. A relative path is relative
62           the current working directory of the emulator.
63
64       When traversing the contents of sys.config and a  filename  is  encoun‐
65       tered, its contents are read and merged with the result so far. When an
66       application configuration tuple {Application,  Env}  is  found,  it  is
67       merged  with  the  result so far. Merging means that new parameters are
68       added and existing parameter values overwritten.
69
70       Example:
71
72       sys.config:
73
74       [{myapp,[{par1,val1},{par2,val2}]},
75        "/home/user/myconfig"].
76
77       myconfig.config:
78
79       [{myapp,[{par2,val3},{par3,val4}]}].
80
81       This yields the following environment for myapp:
82
83       [{par1,val1},{par2,val3},{par3,val4}]
84
85       The behavior if a file specified in sys.config does not  exist,  or  is
86       erroneous,  is  backwards  compatible. Starting the runtime system will
87       fail. Installing a new release version will not fail, but an error mes‐
88       sage is returned and the erroneous file is ignored.
89

SEE ALSO

91       app(4), erts:erl(1), OTP Design Principles
92
93
94
95Ericsson AB                     kernel 5.4.3.2                       config(5)
Impressum