~rdoering/ubuntu/karmic/erlang/fix-535090

« back to all changes in this revision

Viewing changes to lib/kernel/doc/src/heart.xml

  • Committer: Bazaar Package Importer
  • Author(s): Sergei Golovan
  • Date: 2009-02-15 16:42:52 UTC
  • mfrom: (3.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090215164252-q5x4rcf8a5pbesb1
Tags: 1:12.b.5-dfsg-2
Upload to unstable after lenny is released.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="latin1" ?>
 
2
<!DOCTYPE erlref SYSTEM "erlref.dtd">
 
3
 
 
4
<erlref>
 
5
  <header>
 
6
    <copyright>
 
7
      <year>1996</year>
 
8
      <year>2007</year>
 
9
      <holder>Ericsson AB, All Rights Reserved</holder>
 
10
    </copyright>
 
11
    <legalnotice>
 
12
  The contents of this file are subject to the Erlang Public License,
 
13
  Version 1.1, (the "License"); you may not use this file except in
 
14
  compliance with the License. You should have received a copy of the
 
15
  Erlang Public License along with this software. If not, it can be
 
16
  retrieved online at http://www.erlang.org/.
 
17
 
 
18
  Software distributed under the License is distributed on an "AS IS"
 
19
  basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
 
20
  the License for the specific language governing rights and limitations
 
21
  under the License.
 
22
 
 
23
  The Initial Developer of the Original Code is Ericsson AB.
 
24
    </legalnotice>
 
25
 
 
26
    <title>heart</title>
 
27
    <prepared>Magnus Fr&ouml;berg</prepared>
 
28
    <docno></docno>
 
29
    <date>1998-01-28</date>
 
30
    <rev>A</rev>
 
31
  </header>
 
32
  <module>heart</module>
 
33
  <modulesummary>Heartbeat Monitoring of an Erlang Runtime System</modulesummary>
 
34
  <description>
 
35
    <p>This modules contains the interface to the <c>heart</c> process.
 
36
      <c>heart</c> sends periodic heartbeats to an external port
 
37
      program, which is also named <c>heart</c>. The purpose of
 
38
      the heart port program is to check that the Erlang runtime system
 
39
      it is supervising is still running. If the port program has not
 
40
      received any heartbeats within <c>HEART_BEAT_TIMEOUT</c> seconds
 
41
      (default is 60 seconds), the system can be rebooted. Also, if
 
42
      the system is equipped with a hardware watchdog timer and is
 
43
      running Solaris, the watchdog can be used to supervise the entire
 
44
      system.</p>
 
45
    <p>An Erlang runtime system to be monitored by a heart program,
 
46
      should be started with the command line flag <c>-heart</c> (see
 
47
      also <seealso marker="erts:erl">erl(1)</seealso>. The <c>heart</c>
 
48
      process is then started automatically:</p>
 
49
    <pre>
 
50
% <input>erl -heart ...</input></pre>
 
51
    <p>If the system should be rebooted because of missing heart-beats,
 
52
      or a terminated Erlang runtime system, the environment variable
 
53
      <c>HEART_COMMAND</c> has to be set before the system is started.
 
54
      If this variable is not set, a warning text will be printed but
 
55
      the system will not reboot. However, if the hardware watchdog is
 
56
      used, it will trigger a reboot <c>HEART_BEAT_BOOT_DELAY</c>
 
57
      seconds later nevertheless (default is 60).</p>
 
58
    <p>To reboot on the WINDOWS platform <c>HEART_COMMAND</c> can be
 
59
      set to <c>heart -shutdown</c> (included in the Erlang delivery)
 
60
      or of course to any other suitable program which can activate a
 
61
      reboot.</p>
 
62
    <p>The hardware watchdog will not be started under Solaris if
 
63
      the environment variable <c>HW_WD_DISABLE</c> is set.</p>
 
64
    <p>The <c>HEART_BEAT_TIMEOUT</c> and <c>HEART_BEAT_BOOT_DELAY</c>
 
65
      environment variables can be used to configure the heart timeouts,
 
66
      they can be set in the operating system shell before Erlang is
 
67
      started or be specified at the command line:</p>
 
68
    <pre>
 
69
% <input>erl -heart -env HEART_BEAT_TIMEOUT 30 ...</input></pre>
 
70
    <p>The value (in seconds) must be in the range 10 &lt; X &lt;= 65535.</p>
 
71
    <p>It should be noted that if the system clock is adjusted with
 
72
      more than <c>HEART_BEAT_TIMEOUT</c> seconds, <c>heart</c> will
 
73
      timeout and try to reboot the system. This can happen, for
 
74
      example, if the system clock is adjusted automatically by use of
 
75
      NTP (Network Time Protocol).</p>
 
76
    <p>In the following descriptions, all function fails with reason
 
77
      <c>badarg</c> if <c>heart</c> is not started.</p>
 
78
  </description>
 
79
  <funcs>
 
80
    <func>
 
81
      <name>set_cmd(Cmd) -> ok | {error, {bad_cmd, Cmd}}</name>
 
82
      <fsummary>Set a temporary reboot command</fsummary>
 
83
      <type>
 
84
        <v>Cmd = string()</v>
 
85
      </type>
 
86
      <desc>
 
87
        <p>Sets a temporary reboot command. This command is used if 
 
88
          a <c>HEART_COMMAND</c> other than the one specified with
 
89
          the environment variable should be used in order to reboot
 
90
          the system. The new Erlang runtime system will (if it
 
91
          misbehaves) use the environment variable
 
92
          <c>HEART_COMMAND</c> to reboot.</p>
 
93
        <p>Limitations: The length of the <c>Cmd</c> command string
 
94
          must be less than 2047 characters.</p>
 
95
      </desc>
 
96
    </func>
 
97
    <func>
 
98
      <name>clear_cmd() -> ok</name>
 
99
      <fsummary>Clear the temporary boot command</fsummary>
 
100
      <desc>
 
101
        <p>Clears the temporary boot command. If the system terminates,
 
102
          the normal <c>HEART_COMMAND</c> is used to reboot.</p>
 
103
      </desc>
 
104
    </func>
 
105
    <func>
 
106
      <name>get_cmd() -> {ok, Cmd}</name>
 
107
      <fsummary>Get the temporary reboot command</fsummary>
 
108
      <type>
 
109
        <v>Cmd = string()</v>
 
110
      </type>
 
111
      <desc>
 
112
        <p>Get the temporary reboot command. If the command is cleared,
 
113
          the empty string will be returned.</p>
 
114
      </desc>
 
115
    </func>
 
116
  </funcs>
 
117
</erlref>
 
118