1app(5) Files app(5)
2
3
4
6 app - Application resource file.
7
9 The application resource file specifies the resources an application
10 uses, and how the application is started. There must always be one ap‐
11 plication resource file called Application.app for each application Ap‐
12 plication in the system.
13
14 The file is read by the application controller when an application is
15 loaded/started. It is also used by the functions in systools, for exam‐
16 ple when generating start scripts.
17
19 The application resource file is to be called Application.app, where
20 Application is the application name. The file is to be located in di‐
21 rectory ebin for the application.
22
23 The file must contain a single Erlang term, which is called an applica‐
24 tion specification:
25
26 {application, Application,
27 [{description, Description},
28 {id, Id},
29 {vsn, Vsn},
30 {modules, Modules},
31 {maxP, MaxP},
32 {maxT, MaxT},
33 {registered, Names},
34 {included_applications, Apps},
35 {optional_applications, Apps},
36 {applications, Apps},
37 {env, Env},
38 {mod, Start},
39 {start_phases, Phases},
40 {runtime_dependencies, RTDeps}]}.
41
42 Value Default
43 ----- -------
44 Application atom() -
45 Description string() ""
46 Id string() ""
47 Vsn string() ""
48 Modules [Module] []
49 MaxP int() infinity
50 MaxT int() infinity
51 Names [Name] []
52 Apps [App] []
53 Env [{Par,Val}] []
54 Start {Module,StartArgs} []
55 Phases [{Phase,PhaseArgs}] undefined
56 RTDeps [ApplicationVersion] []
57
58 Module = Name = App = Par = Phase = atom()
59 Val = StartArgs = PhaseArgs = term()
60 ApplicationVersion = string()
61
62 Application:
63 Application name.
64
65 For the application controller, all keys are optional. The respective
66 default values are used for any omitted keys.
67
68 The functions in systools require more information. If they are used,
69 the following keys are mandatory:
70
71 * description
72
73 * vsn
74
75 * modules
76
77 * registered
78
79 * applications
80
81 The other keys are ignored by systools.
82
83 description:
84 A one-line description of the application.
85
86 id:
87 Product identification, or similar.
88
89 vsn:
90 Version of the application.
91
92 modules:
93 All modules introduced by this application. systools uses this list
94 when generating start scripts and tar files. A module can only be
95 defined in one application.
96
97 maxP:
98 Deprecated - is ignored
99
100 Maximum number of processes allowed in the application.
101
102 maxT:
103 Maximum time, in milliseconds, that the application is allowed to
104 run. After the specified time, the application terminates automati‐
105 cally.
106
107 registered:
108 All names of registered processes started in this application. sys‐
109 tools uses this list to detect name clashes between different ap‐
110 plications.
111
112 included_applications:
113 All applications included by this application. When this applica‐
114 tion is started, all included applications are loaded automati‐
115 cally, but not started, by the application controller. It is as‐
116 sumed that the top-most supervisor of the included application is
117 started by a supervisor of this application.
118
119 applications:
120 All applications that must be started before this application. If
121 an application is also listed in optional_applications, then the
122 application is not required to exist (but if it exists, it is also
123 guaranteed to be started before this one).
124
125 systools uses this list to generate correct start scripts. Defaults
126 to the empty list, but notice that all applications have dependen‐
127 cies to (at least) Kernel and STDLIB.
128
129 optional_applications:
130 A list of applications that are optional. Note if you want an op‐
131 tional dependency to be automatically started before the current
132 application whenever it is available, it must be listed on both ap‐
133 plications and optional_applications.
134
135 env:
136 Configuration parameters used by the application. The value of a
137 configuration parameter is retrieved by calling applica‐
138 tion:get_env/1,2. The values in the application resource file can
139 be overridden by values in a configuration file (see config(4)) or
140 by command-line flags (see erts:erl(1)).
141
142 mod:
143 Specifies the application callback module and a start argument, see
144 application(3).
145
146 Key mod is necessary for an application implemented as a supervi‐
147 sion tree, otherwise the application controller does not know how
148 to start it. mod can be omitted for applications without processes,
149 typically code libraries, for example, STDLIB.
150
151 start_phases:
152 A list of start phases and corresponding start arguments for the
153 application. If this key is present, the application master, in ad‐
154 dition to the usual call to Module:start/2, also calls Mod‐
155 ule:start_phase(Phase,Type,PhaseArgs) for each start phase defined
156 by key start_phases. Only after this extended start procedure, ap‐
157 plication:start(Application) returns.
158
159 Start phases can be used to synchronize startup of an application
160 and its included applications. In this case, key mod must be speci‐
161 fied as follows:
162
163 {mod, {application_starter,[Module,StartArgs]}}
164
165 The application master then calls Module:start/2 for the primary
166 application, followed by calls to Module:start_phase/3 for each
167 start phase (as defined for the primary application), both for the
168 primary application and for each of its included applications, for
169 which the start phase is defined.
170
171 This implies that for an included application, the set of start
172 phases must be a subset of the set of phases defined for the pri‐
173 mary application. For more information, see OTP Design Principles.
174
175 runtime_dependencies:
176 A list of application versions that the application depends on. An
177 example of such an application version is "kernel-3.0". Application
178 versions specified as runtime dependencies are minimum require‐
179 ments. That is, a larger application version than the one specified
180 in the dependency satisfies the requirement. For information about
181 how to compare application versions, see section Versions in the
182 System Principles User's Guide.
183
184 Notice that the application version specifies a source code ver‐
185 sion. One more, indirect, requirement is that the installed binary
186 application of the specified version is built so that it is compat‐
187 ible with the rest of the system.
188
189 Some dependencies can only be required in specific runtime scenar‐
190 ios. When such optional dependencies exist, these are specified and
191 documented in the corresponding "App" documentation of the specific
192 application.
193
194 Warning:
195 The runtime_dependencies key was introduced in OTP 17.0. The type of
196 its value might be subject to changes during the OTP 17 release.
197
198
199 Warning:
200 All runtime dependencies specified in OTP applications during the OTP
201 17 release may not be completely correct. This is actively being
202 worked on. Declared runtime dependencies in OTP applications are ex‐
203 pected to be correct in OTP 18.
204
205
207 application(3), systools(3)
208
209
210
211Ericsson AB kernel 8.5.4.2 app(5)