Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

config(5) [linux man page]

config(5)							       Files								 config(5)

NAME
config - Configuration file. DESCRIPTION
A configuration file contains values for configuration parameters for the applications in the system. The erl command line argument -config Name tells the system to use data in the system configuration file Name.config . Configuration parameter values in the configuration file will override the values in the application resource files (see app(5) ). The val- ues in the configuration file can be overridden by command line flags (see erl(1) ). The value of a configuration parameter is retrieved by calling application:get_env/1,2 . FILE SYNTAX
The configuration file should be called Name.config where Name is an arbitrary name. The .config file contains one single Erlang term. The file has the following syntax: [{Application1, [{Par11, Val11}, ..]}, .. {ApplicationN, [{ParN1, ValN1}, ..]}]. * Application = atom() is the name of the application. * Par = atom() is the name of a configuration parameter. * Val = term() is the value of a configuration parameter. SYS.CONFIG When starting Erlang in embedded mode, it is assumed that exactly one system configuration file is used, named sys.config . This file should be located in $ROOT/releases/Vsn , where $ROOT is the Erlang/OTP root installation directory and Vsn is the release version. Release handling relies on this assumption. When installing a new release version, the new sys.config is read and used to update the appli- cation configurations. This means that specifying another, or additional, .config files would lead to inconsistent update of application configurations. There- fore, in Erlang 5.4/OTP R10B, the syntax of sys.config was extended to allow pointing out other .config files: [{Application, [{Par, Val}]} | File]. * File = string() is the name of another .config file. The extension .config may be omitted. It is recommended to use absolute paths. A relative path is relative the current working directory of the emulator. When traversing the contents of sys.config and a filename is encountered, its contents are read and merged with the result so far. When an application configuration tuple {Application, Env} is found, it is merged with the result so far. Merging means that new parameters are added and existing parameter values overwritten. Example: sys.config: [{myapp,[{par1,val1},{par2,val2}]}, "/home/user/myconfig"]. myconfig.config: [{myapp,[{par2,val3},{par3,val4}]}]. This will yield the following environment for myapp : [{par1,val1},{par2,val3},{par3,val4}] The behaviour if a file specified in sys.config 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. SEE ALSO
app(5) , erl(1) , OTP Design Principles Ericsson AB kernel 2.14.3 config(5)

Check Out this Related Man Page

app(5)								       Files								    app(5)

NAME
app - Application resource file. DESCRIPTION
The application resource file specifies the resources an application uses, and how the application is started. There must always be one application resource file called Application.app for each application Application in the system. The file is read by the application controller when an application is loaded/started. It is also used by the functions in systools , for example when generating start scripts. FILE SYNTAX
The application resource file should be called Application.app where Application is the name of the application. The file should be located in the ebin directory for the application. It must contain one single Erlang term, which is called an application specification : {application, Application, [{description, Description}, {id, Id}, {vsn, Vsn}, {modules, Modules}, {maxP, MaxP}, {maxT, MaxT}, {registered, Names}, {included_applications, Apps}, {applications, Apps}, {env, Env}, {mod, Start}, {start_phases, Phases}]}. Value Default ----- ------- Application atom() - Description string() "" Id string() "" Vsn string() "" Modules [Module] [] MaxP int() infinity MaxT int() infinity Names [Name] [] Apps [App] [] Env [{Par,Val}] [] Start {Module,StartArgs} undefined Phases [{Phase,PhaseArgs}] undefined Module = Name = App = Par = Phase = atom() Val = StartArgs = PhaseArgs = term() Application is the name of the application. For the application controller, all keys are optional. The respective default values are used for any omitted keys. The functions in systools require more information. If they are used, the following keys are mandatory: description , vsn , modules , reg- istered and applications . The other keys are ignored by systools . description : A one-line description of the application. id : Product identification, or similar. vsn : The version of the application. modules : All modules introduced by this application. systools uses this list when generating start scripts and tar files. A module can only be defined in one application. maxP : Deprecated - will be ignored The maximum number of processes allowed in the application. maxT : The maximum time in milliseconds that the application is allowed to run. After the specified time the application will automatically terminate. registered : All names of registered processes started in this application. systools uses this list to detect name clashes between different appli- cations. included_applications : All applications which are included by this application. When this application is started, all included application will automatically be loaded, but not started, by the application controller. It is assumed that the topmost supervisor of the included application is started by a supervisor of this application. applications : All applications which must be started before this application is allowed to be started. systools uses this list to generate correct start scripts. Defaults to the empty list, but note that all applications have dependencies to (at least) kernel and stdlib . env : Configuration parameters used by the application. The value of a configuration parameter is retrieved by calling applica- tion:get_env/1,2 . The values in the application resource file can be overridden by values in a configuration file (see config(5) ) or by command line flags (see erl(1) ). mod : Specifies the application callback module and a start argument, see application(3erl) . The mod key is necessary for an application implemented as a supervision tree, or the application controller will not know how to start it. The mod key can be omitted for applications without processes, typically code libraries such as the application STDLIB. start_phases : A list of start phases and corresponding start arguments for the application. If this key is present, the application master will - in addition to the usual call to Module:start/2 - also call Module:start_phase(Phase,Type,PhaseArgs) for each start phase defined by the start_phases key, and only after this extended start procedure will application:start(Application) return. Start phases may be used to synchronize startup of an application and its included applications. In this case, the mod key must be specified as: {mod, {application_starter,[Module,StartArgs]}} The application master will then call Module:start/2 for the primary application, followed by calls to Module:start_phase/3 for each start phase (as defined for the primary application) both for the primary application and for each of its included application, for which the start phase is defined. This implies that for an included application, the set of start phases must be a subset of the set of phases defined for the primary application. Refer to OTP Design Principles for more information. SEE ALSO
application(3erl) , systools(3erl) Ericsson AB kernel 2.14.3 app(5)
Man Page