| Kernel(Application) | Ericsson AB | Kernel(Application) |
NAME
Kernel Application
DESCRIPTION
Description
The Kernel application has all the code necessary to run the Erlang runtime system: file servers, code servers, and so on.
The Kernel application is the first application started. It is mandatory in the sense that the minimal system based on Erlang/OTP consists of Kernel and STDLIB. Kernel contains the following functional areas:
Logger Handlers
Two standard logger handlers are defined in the Kernel application. These are described in the Kernel User's Guide, and in the logger_std_h and logger_disk_log_h manual pages.
OS Signal Event Handler
Asynchronous OS signals may be subscribed to via the Kernel applications event manager (see OTP Design Principles and gen_event) registered as erl_signal_server. A default signal handler is installed which handles the following signals:
sigusr1
sigquit
sigterm
Events
Any event handler added to erl_signal_server must handle the following events.
sighup
sigquit
sigabrt
sigalrm
sigterm
sigusr1
sigusr2
sigchld
sigstop
sigtstp
sigcont
sigwinch
siginfo
Setting OS signals are described in os:set_signal/2.
Configuration
The following configuration parameters are defined for the Kernel application. For more information about configuration parameters, see file app.
connect_all = true | false
The now deprecated command line argument -connect_all <boolean> has the same effect as the connect_all configuration parameter. If this configuration parameter is defined, it will override the command line argument.
distributed = [Distrib]
The parameter is described in application:load/2.
dist_auto_connect = Value
once
epmd_module = module()
The now deprecated command line argument -epmd_module <module> has the same effect as the epmd_module configuration parameter. If this configuration parameter is defined, it will override the command line argument.
erl_epmd_node_listen_port = integer()
The now deprecated command line argument erl_epmd_port <module> has the same effect as the erl_epmd_node_listen_port configuration parameter. If this configuration parameter is defined, it will override the command line argument.
permissions = [Perm]
Permissions are described in application:permit/2.
logger = [Config]
The logger parameter is described in section Logging in the Kernel User's Guide.
logger_level = Level
Level = emergency | alert | critical | error | warning | notice | info | debug | all | none
To change the primary log level at runtime, use logger:set_primary_config(level, Level).
Defaults to notice.
logger_metadata = Metadata
Metadata = map()
Defaults to #{}.
logger_sasl_compatible = true | false
If this parameter is set to true, the default Logger handler does not log any progress-, crash-, or supervisor reports. If the SASL application is then started, it adds a Logger handler named sasl, which logs these events according to values of the SASL configuration parameter sasl_error_logger and sasl_errlog_type.
See section Deprecated Error Logger Event Handlers and Configuration in the sasl(6) manual page for information about the SASL configuration parameters.
See section SASL Error Logging in the SASL User's Guide, and section Backwards Compatibility with error_logger in the Kernel User's Guide for information about the SASL error logging functionality, and how Logger can be backwards compatible with this.
Defaults to false.
NOTE: If this parameter is set to true, sasl_errlog_type indicates that progress reports shall be logged, and the configured primary log level is notice or more severe, then SASL automatically sets the primary log level to info. That is, this setting can potentially overwrite the value of the Kernel configuration parameter logger_level. This is to allow progress reports, which have log level info, to be forwarded to the handlers.
global_groups = [GroupTuple]
inet_default_connect_options = [{Opt, Val}]
inet_default_listen_options = [{Opt, Val}]
inet_dist_use_interface = ip_address()
inet_dist_listen_options = Opts
inet_dist_connect_options = Opts
inet_parse_error_log = silent
inetrc = Filename
net_setuptime = SetupTime
SetupTime must be a positive integer or floating point number, and is interpreted as the maximum allowed time for each network operation during connection setup to another Erlang node. The maximum allowed value is 120. If higher values are specified, 120 is used. Default is 7 seconds if the variable is not specified, or if the value is incorrect (for example, not a number).
Notice that this value does not limit the total connection setup time, but rather each individual network operation during the connection setup and handshake.
net_ticker_spawn_options = Opts
Note that the behavior described above is only true if the distribution carrier protocol used is implemented as described in ERTS User's Guide ➜ How to implement an Alternative Carrier for the Erlang Distribution ➜ Distribution Module without further alterations. The implementer of the distribution carrier protocol used, may have chosen to ignore the net_ticker_spawn_options parameter or altered its behavior. Currently all distribution modules shipped with OTP do, however, behave as described above.
net_tickintensity = NetTickIntensity
Net tick intensity specifies how many ticks to send during a net tick time period when no other data is sent over a connection to another node. This also determines how often to check for data from the other node. The higher net tick intensity, the closer to the chosen net tick time period the node will detect an unresponsive node. The net tick intensity defaults to 4. The value of NetTickIntensity should be an integer in the range 4..1000. If the NetTickIntensity is not an integer or an integer less than 4, 4 will silently be used. If NetTickIntensity is an integer larger than 1000, 1000 will silently be used.
NOTE: Note that all communicating nodes are expected to use the same net tick intensity as well as the same net tick time.
WARNING: Be careful not to set a too high net tick intensity, since you can overwhelm the node with work if it is set too high.
net_ticktime = NetTickTime
Net tick time together with net tick intensity determines an interval TickInterval = NetTickTime/NetTickIntensity. Once every TickInterval seconds, each connected node is ticked if nothing has been sent to it during that last TickInterval seconds. A tick is a small package sent on the connection. A connected node is considered to be down if no ticks or payload packages have been received during the last NetTickIntensity number of TickInterval seconds intervals. This ensures that nodes that are not responding, for reasons such as hardware errors, are considered to be down.
As the availability is only checked every TickInterval seconds, the actual time T a node have been unresponsive when detected may vary between MinT and MaxT, where:
-
MinT = NetTickTime - NetTickTime / NetTickIntensity MaxT = NetTickTime + NetTickTime / NetTickIntensity
NetTickTime defaults to 60 seconds and NetTickIntensity defaults to 4. Thus, 45 < T < 75 seconds.
NOTE: Notice that all communicating nodes are to have the same NetTickTime and NetTickIntensity values specified, as it determines both the frequency of outgoing ticks and the expected frequency of incominging ticks.
NetTickTime needs to be a multiple of NetTickIntensity. If the configured values are not, NetTickTime will internally be rounded up to the nearest millisecond. net_kernel:get_net_ticktime() will, however, report net tick time truncated to the nearest second.
Normally, a terminating node is detected immediately by the transport protocol (like TCP/IP).
prevent_overlapping_partitions = true | false
shutdown_timeout = integer() | infinity
sync_nodes_mandatory = [NodeName]
sync_nodes_optional = [NodeName]
sync_nodes_timeout = integer() | infinity
start_distribution = true | false
Defaults to true.
start_dist_ac = true | false
Defaults to false. If this parameter is undefined, the server is started if parameter distributed is set.
start_boot_server = true | false
Defaults to false.
boot_server_slaves = [SlaveIP]
SlaveIP = string() | atom | {integer(),integer(),integer(),integer()},
where 0 <= integer() <=255.
Examples of SlaveIP in atom, string, and tuple form:
'150.236.16.70', "150,236,16,70", {150,236,16,70}.
Defaults to [].
start_disk_log = true | false
Defaults to false.
start_pg = true | false
Defaults to false.
start_timer = true | false
Defaults to false.
shell_docs_ansi = boolean()
See also shell_docs:config/0.
shell_history = enabled | disabled | module()
shell_history_drop = [string()]
shell_history_file_bytes = integer()
shell_history_path = string()
shutdown_func = {Mod :: atom(), Func :: atom()}
Where:
Specifies a list of rules for use by filelib:find_file/2 filelib:find_source/2 If this is set to some other value than the empty list, it replaces the default rules. Rules can be simple pairs of directory suffixes, such as {"ebin", "src"}, which are used by filelib:find_file/2, or triples specifying separate directory suffix rules depending on file name extensions, for example [{".beam", ".erl", [{"ebin", "src"}]}, which are used by filelib:find_source/2. Both kinds of rules can be mixed in the list.
The interpretation of ObjDirSuffix and SrcDirSuffix is as follows: if the end of the directory name where an object is located matches ObjDirSuffix, then the name created by replacing ObjDirSuffix with SrcDirSuffix is expanded by calling filelib:wildcard/1, and the first regular file found among the matches is the source file.
standard_io_encoding = Encoding
This works similarly to io:setopts(standard_io, {encoding, Encoding}) but is applied before any bytes on standard_io may have been read.
Encoding is one of:
unicode
latin1
_
See Escripts and non-interactive I/O in Unicode Usage in Erlang for more details.
os_cmd_shell = string()
Deprecated Configuration Parameters
In Erlang/OTP 21.0, a new API for logging was added. The old error_logger event manager, and event handlers running on this manager, still work, but they are no longer used by default.
The following application configuration parameters can still be set, but they are only used if the corresponding configuration parameters for Logger are not set.
error_logger
-
erl -kernel logger '[{handler,default,logger_std_h,#{config=>#{file=>"/tmp/erlang.log"}}}]'
error_logger_format_depth
-
erl -kernel logger '[{handler,default,logger_std_h,#{formatter=>{logger_formatter,#{legacy_header=>true,template=>[{logger_formatter,header},"\n",msg,"\n"],depth=>10}}}]'
See Backwards compatibility with error_logger for more information.
| 6 | kernel 10.5 |