aboutsummaryrefslogblamecommitdiffstats
path: root/lib/kernel/doc/src/kernel_app.xml
blob: 956c57f7c15bf873058d715bc4220f978ed794e2 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
                                       




                                     
                                        


                                                        










                                                                              
















                                                                      
                                                                                                     





                                                                     
                                                   























                                                                        

                                                                      
























                                                                            

                                                                          









                                                                      
                                                                     

                                                                       


                                                                       

                                                                       










                                                                      

                                                                          
























                                                                      



































                                                                         

                                                    

                                                                       









                                                                                                 
                                                           



                                                                  
                                                                                   




                                                                        

                                                                          









                                                                    











                                                                                 
















































                                                                                   








                                                                      



































                                                                        

                                                                               


















                                                                                          

                                                                             




                                                                        

                                                    






                                                                        

                                                                              







































                                                                       
                                                        



                                                  
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE appref SYSTEM "appref.dtd">

<appref>
  <header>
    <copyright>
      <year>1996</year><year>2015</year>
      <holder>Ericsson AB. All Rights Reserved.</holder>
    </copyright>
    <legalnotice>
      Licensed under the Apache License, Version 2.0 (the "License");
      you may not use this file except in compliance with the License.
      You may obtain a copy of the License at
 
          http://www.apache.org/licenses/LICENSE-2.0

      Unless required by applicable law or agreed to in writing, software
      distributed under the License is distributed on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
      See the License for the specific language governing permissions and
      limitations under the License.
    
    </legalnotice>

    <title>kernel</title>
    <prepared></prepared>
    <docno></docno>
    <date></date>
    <rev></rev>
  </header>
  <app>kernel</app>
  <appsummary>The Kernel Application</appsummary>
  <description>
    <p>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. The Kernel application
      contains the following services:</p>
    <list type="bulleted">
      <item>application controller, see <seealso marker="application">application(3)</seealso></item>
      <item><c>code</c></item>
      <item><c>disk_log</c></item>
      <item><c>dist_ac</c>, distributed application controller</item>
      <item><c>erl_boot_server</c></item>
      <item><c>erl_ddll</c></item>
      <item><c>error_logger</c></item>
      <item><c>error_logger_format_depth</c></item>
      <item><c>file</c></item>
      <item><c>global</c></item>
      <item><c>global_group</c></item>
      <item><c>heart</c></item>
      <item><c>inet</c></item>
      <item><c>net_kernel</c></item>
      <item><c>os</c></item>
      <item><c>pg2</c></item>
      <item><c>rpc</c></item>
      <item><c>seq_trace</c></item>
      <item><c>user</c></item>
    </list>
  </description>

  <section>
    <title>Error Logger Event Handlers</title>
    <p>Two standard error logger event handlers are defined in
      the Kernel application. These are described in
      <seealso marker="error_logger">error_logger(3)</seealso>.</p>
  </section>

  <section>
    <title>Configuration</title>
    <p>The following configuration parameters are defined for the Kernel
      application. See <seealso marker="app">app(4)</seealso> for more
      information about configuration parameters.</p>
    <taglist>
      <tag><c>browser_cmd = string() | {M,F,A}</c></tag>
      <item>
        <p>When pressing the Help button in a tool such as Debugger or
          TV, the help text (an HTML file <c>File</c>) is by default
          displayed in a Netscape browser which is required to be up and
          running. This parameter can be used to change the command for
          how to display the help text if another browser than Netscape
          is preferred, or another platform than Unix or Windows is
          used.</p>
        <p>If set to a string <c>Command</c>, the command
          <c>"Command File"</c> will be evaluated using <c>os:cmd/1</c>.</p>
        <p>If set to a module-function-args tuple <c>{M,F,A}</c>,
          the call <c>apply(M,F,[File|A])</c> will be evaluated.</p>
      </item>
      <tag><c>distributed = [Distrib]</c></tag>
      <item>
        <p>Specifies which applications are distributed and on which
          nodes they may execute. In this parameter:</p>
        <list type="bulleted">
          <item><c>Distrib = {App,Nodes} | {App,Time,Nodes}</c></item>
          <item><c>App = atom()</c></item>
          <item><c>Time = integer()>0</c></item>
          <item><c>Nodes = [node() | {node(),...,node()}]</c></item>
        </list>
        <p>The parameter is described in
	  <seealso marker="application">application(3)</seealso>, function
          <c>load/2</c>.</p>
      </item>
      <tag><c>dist_auto_connect = Value</c></tag>
      <item>
        <p>Specifies when nodes will be automatically connected. If
          this parameter is not specified, a node is always
          automatically connected, e.g when a message is to be sent to
          that node. <c>Value</c> is one of:</p>
        <taglist>
          <tag><c>never</c></tag>
          <item>Connections are never automatically established, they
           must be explicitly connected. See
	   <seealso marker="net_kernel">net_kernel(3)</seealso>.</item>
          <tag><c>once</c></tag>
          <item>Connections will be established automatically, but only
           once per node. If a node goes down, it must thereafter be
           explicitly connected. See
	   <seealso marker="net_kernel">net_kernel(3)</seealso>.</item>
        </taglist>
      </item>
      <tag><c>permissions = [Perm]</c></tag>
      <item>
        <p>Specifies the default permission for applications when they
          are started. In this parameter:</p>
        <list type="bulleted">
          <item><c>Perm = {ApplName,Bool}</c></item>
          <item><c>ApplName = atom()</c></item>
          <item><c>Bool = boolean()</c></item>
        </list>
        <p>Permissions are described in
	  <seealso marker="application">application(3)</seealso>, function
          <c>permit/2</c>.</p>
      </item>
      <tag><c>error_logger = Value</c></tag>
      <item>
        <p><c>Value</c> is one of:</p>
        <taglist>
          <tag><c>tty</c></tag>
          <item>Installs the standard event handler which prints error
           reports to <c>stdio</c>. This is the default option.</item>
          <tag><c>{file, FileName}</c></tag>
          <item>Installs the standard event handler which prints error
           reports to the file <c>FileName</c>, where <c>FileName</c>
           is a string.</item>
          <tag><c>false</c></tag>
          <item>
            <p>No standard event handler is installed, but
              the initial, primitive event handler is kept, printing
              raw event messages to tty.</p>
          </item>
          <tag><c>silent</c></tag>
          <item>
            <p>Error logging is turned off.</p>
          </item>
        </taglist>
      </item>
      <tag><c>error_logger_format_depth = Depth</c></tag>
      <item>
        <marker id="error_logger_format_depth"></marker>
	<p>This parameter can be used to limit the size of the
	formatted output from the error logger event handlers.</p>

	<note><p>This configuration parameter was introduced in OTP 18.1.
	It is currently experimental. Based on user feedback it
	may be changed or improved in future releases, for example
	to gain better control over how to limit the size of the
	formatted output. We have no plans to entirely remove this
	new feature, unless it turns out to be completely
	useless. In OTP 19, the default may be changed to limit the
	formatted output.</p></note>

        <p><c>Depth</c> is a positive integer that is the maximum
        depth to which terms are printed by the error logger event
        handlers included in OTP. Specifically, the two event handlers
        defined by the <c>Kernel</c> application and the two event
        handlers in the <c>SASL</c> application will use this
        configuration parameter. (If you have implemented you own
        error handlers, this configuration parameter will have no
        effect on them.)</p>

	<p>The way <c>Depth</c> is used, is that format strings
	string passed to the event handlers will be rewritten.
	The "~p" and "~w" format controls will be replaced with
	"~P" and "~W", respectively, and <c>Depth</c> will be
	used as the depth parameter. See
	<seealso marker="stdlib:io#format/2">io:format/2</seealso>.</p>

	<note><p>A reasonable starting value for <c>Depth</c> is
	<c>30</c>.  You should test crashing various processes in your
	application and examine the logs from the crashes, and then
	either increase or decrease the value.</p></note>
     </item>
      <tag><c>global_groups = [GroupTuple]</c></tag>
      <item>
        <p>Defines global groups, see
	  <seealso marker="global_group">global_group(3)</seealso>.</p>
        <list type="bulleted">
          <item><c>GroupTuple = {GroupName, [Node]} | {GroupName, PublishType, [Node]}</c></item>
          <item><c>GroupName = atom()</c></item>
          <item><c>PublishType = normal | hidden</c></item>
          <item><c>Node = node()</c></item>
        </list>
      </item>
      <tag><c>inet_default_connect_options = [{Opt, Val}]</c></tag>
      <item>
        <p>Specifies default options for <c>connect</c> sockets,
          see <seealso marker="inet">inet(3)</seealso>.</p>
      </item>
      <tag><c>inet_default_listen_options = [{Opt, Val}]</c></tag>
      <item>
        <p>Specifies default options for <c>listen</c> (and
          <c>accept</c>) sockets, see <seealso marker="inet">inet(3)</seealso>.</p>
      </item>
      <tag><c>{inet_dist_use_interface, ip_address()}</c></tag>
      <item>
        <p>If the host of an Erlang node has several network interfaces,
          this parameter specifies which one to listen on. See
          <seealso marker="inet">inet(3)</seealso> for the type definition
	  of <c>ip_address()</c>.</p>
      </item>
      <tag><c>{inet_dist_listen_min, First}</c></tag>
      <item>
        <p>See below.</p>
      </item>
      <tag><c>{inet_dist_listen_max, Last}</c></tag>
      <item>
        <p>Define the <c>First..Last</c> port range for the listener
          socket of a distributed Erlang node.</p>
      </item>
      <tag><c>{inet_dist_listen_options, Opts}</c></tag>
      <item>
        <p>Define a list of extra socket options to be used when opening the
	  listening socket for a distributed Erlang node.
	  See <seealso marker="gen_tcp#listen/2">gen_tcp:listen/2</seealso></p>
      </item>
      <tag><c>{inet_dist_connect_options, Opts}</c></tag>
      <item>
        <p>Define a list of extra socket options to be used when connecting to
	  other distributed Erlang nodes.
	  See <seealso marker="gen_tcp#connect/4">gen_tcp:connect/4</seealso></p>
      </item>
      <tag><c>inet_parse_error_log = silent</c></tag>
      <item>
        <p>If this configuration parameter is set, no
          <c>error_logger</c> messages are generated when erroneous
          lines are found and skipped in the various Inet configuration
          files.</p>
      </item>
      <tag><c>inetrc = Filename</c></tag>
      <item>
        <p>The name (string) of an Inet user configuration file. See
          ERTS User's Guide, Inet configuration.</p>
      </item>
      <tag><c>net_setuptime = SetupTime</c></tag>
      <item>
        <marker id="net_setuptime"></marker>
        <p><c>SetupTime</c> must be a positive integer or floating point
          number, and will be interpreted as the maximally allowed time
          for each network operation during connection setup to another
          Erlang node. The maximum allowed value is 120; if higher values
          are given, 120 will be used. The default value if the variable
          is not given, or if the value is incorrect (e.g. not a number),
          is 7 seconds.</p>
        <p>Note that this value does not limit the total connection
          setup time, but rather each individual network operation during
          the connection setup and handshake.</p>
      </item>
      <tag><c>net_ticktime = TickTime</c></tag>
      <item>
        <marker id="net_ticktime"></marker>
        <p>Specifies the <c>net_kernel</c> tick time. <c>TickTime</c>
          is given in seconds. Once every <c>TickTime/4</c> second, all
          connected nodes are ticked (if anything else has been written
          to a node) and if nothing has been received from another node
          within the last four (4) tick times that node is considered
          to be down. This ensures that nodes which are not responding,
          for reasons such as hardware errors, are considered to be
          down.</p>
        <p>The time <c>T</c>, in which a node that is not responding is
          detected, is calculated as: <c><![CDATA[MinT < T < MaxT]]></c> where:</p>
        <code type="none">
MinT = TickTime - TickTime / 4
MaxT = TickTime + TickTime / 4</code>
        <p><c>TickTime</c> is by default 60 (seconds). Thus,
          <c><![CDATA[45 < T < 75]]></c> seconds.</p>
        <p><em>Note:</em> All communicating nodes should have the same 
          <c>TickTime</c> value specified.</p>
        <p><em>Note:</em> Normally, a terminating node is detected
          immediately.</p>
      </item>
      <tag><c>shutdown_timeout = integer() | infinity</c></tag>
      <item>
        <p>Specifies the time <c>application_controller</c> will wait
          for an application to terminate during node shutdown. If the
          timer expires, <c>application_controller</c> will brutally
          kill <c>application_master</c> of the hanging
          application. If this parameter is undefined, it defaults
          to <c>infinity</c>.</p>
      </item>
      <tag><c>sync_nodes_mandatory = [NodeName]</c></tag>
      <item>
        <p>Specifies which other nodes <em>must</em> be alive in order
          for this node to start properly. If some node in the list
          does not start within the specified time, this node will not
          start either. If this parameter is undefined, it defaults to
          [].</p>
      </item>
      <tag><c>sync_nodes_optional = [NodeName]</c></tag>
      <item>
        <p>Specifies which other nodes <em>can</em> be alive in order
          for this node to start properly. If some node in this list
          does not start within the specified time, this node starts
          anyway. If this parameter is undefined, it defaults to
          the empty list.</p>
      </item>
      <tag><c>sync_nodes_timeout = integer() | infinity</c></tag>
      <item>
        <p>Specifies the amount of time (in milliseconds) this node
          will wait for the mandatory and optional nodes to start. If
          this parameter is undefined, no node synchronization is
          performed. This option also makes sure that <c>global</c> is
          synchronized.</p>
      </item>
      <tag><c>start_dist_ac = true | false</c></tag>
      <item>
        <p>Starts the <c>dist_ac</c> server if the parameter is
          <c>true</c>. This parameter should be set to <c>true</c> for
          systems that use distributed applications.</p>
        <p>The default value is <c>false</c>.  If this parameter is
          undefined, the server is started if the parameter
          <c>distributed</c> is set.</p>
      </item>
      <tag><c>start_boot_server = true | false</c></tag>
      <item>
        <p>Starts the <c>boot_server</c> if the parameter is <c>true</c>
          (see <seealso marker="erl_boot_server">erl_boot_server(3)</seealso>).
	  This parameter should be
          set to <c>true</c> in an embedded system which uses this
          service.</p>
        <p>The default value is <c>false</c>.</p>
      </item>
      <tag><c>boot_server_slaves = [SlaveIP]</c></tag>
      <item>
        <p>If the <c>start_boot_server</c> configuration parameter is
          <c>true</c>, this parameter can be used to initialize
          <c>boot_server</c> with a list of slave IP addresses.
          <c>SlaveIP = string() | atom | {integer(),integer(),integer(),integer()}</c></p>
        <p>where <c><![CDATA[0 <= integer() <=255]]></c>.</p>
        <p>Examples of <c>SlaveIP</c> in atom, string and tuple form
          are:          <br></br>
<c>'150.236.16.70', "150,236,16,70", {150,236,16,70}</c>.</p>
        <p>The default value is <c>[]</c>.</p>
      </item>
      <tag><c>start_disk_log = true | false</c></tag>
      <item>
        <p>Starts the <c>disk_log_server</c> if the parameter is
          <c>true</c> (see <seealso marker="disk_log">disk_log(3)</seealso>).
	  This parameter should be
          set to true in an embedded system which uses this service.</p>
        <p>The default value is <c>false</c>.</p>
      </item>
      <tag><c>start_pg2 = true | false</c></tag>
      <item>
        <p>Starts the <c>pg2</c> server (see
	  <seealso marker="pg2">pg2(3)</seealso>) if
          the parameter is <c>true</c>. This parameter should be set to
          <c>true</c> in an embedded system which uses this service.</p>
        <p>The default value is <c>false</c>.</p>
      </item>
      <tag><c>start_timer = true | false</c></tag>
      <item>
        <p>Starts the <c>timer_server</c> if the parameter is
          <c>true</c> (see <seealso marker="stdlib:timer">timer(3)</seealso>).
	  This parameter should be
          set to <c>true</c> in an embedded system which uses this
          service.</p>
        <p>The default value is <c>false</c>.</p>
      </item>
      <tag><c>shutdown_func = {Mod, Func}</c></tag>
      <item>
        <p>Where:</p>
        <list type="bulleted">
          <item><c>Mod = atom()</c></item>
          <item><c>Func = atom()</c></item>
        </list>
        <p>Sets a function that <c>application_controller</c> calls
          when it starts to terminate. The function is called as:
          <c>Mod:Func(Reason)</c>, where <c>Reason</c> is the terminate
          reason for <c>application_controller</c>, and it must
          return as soon as possible for <c>application_controller</c>
          to terminate properly.</p>
      </item>
    </taglist>
  </section>

  <section>
    <title>See Also</title>
    <p><seealso marker="app">app(4)</seealso>,
      <seealso marker="application">application(3)</seealso>, 
      <seealso marker="code">code(3)</seealso>, 
      <seealso marker="disk_log">disk_log(3)</seealso>, 
      <seealso marker="erl_boot_server">erl_boot_server(3)</seealso>,
      <seealso marker="erl_ddll">erl_ddll(3)</seealso>, 
      <seealso marker="error_logger">error_logger(3)</seealso>, 
      <seealso marker="file">file(3)</seealso>, 
      <seealso marker="global">global(3)</seealso>, 
      <seealso marker="global_group">global_group(3)</seealso>, 
      <seealso marker="heart">heart(3)</seealso>, 
      <seealso marker="inet">inet(3)</seealso>, 
      <seealso marker="net_kernel">net_kernel(3)</seealso>, 
      <seealso marker="os">os(3)</seealso>, 
      <seealso marker="pg2">pg2(3)</seealso>, 
      <seealso marker="rpc">rpc(3)</seealso>, 
      <seealso marker="seq_trace">seq_trace(3)</seealso>, 
      <seealso marker="stdlib:timer">timer(3)</seealso>,
      <seealso marker="user">user(3)</seealso></p>
  </section>
</appref>