Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

heart(3erl) [linux man page]

heart(3erl)						     Erlang Module Definition						       heart(3erl)

NAME
heart - Heartbeat Monitoring of an Erlang Runtime System DESCRIPTION
This modules contains the interface to the heart process. heart sends periodic heartbeats to an external port program, which is also named heart . The purpose of the heart port program is to check that the Erlang runtime system it is supervising is still running. If the port program has not received any heartbeats within HEART_BEAT_TIMEOUT seconds (default is 60 seconds), the system can be rebooted. Also, if the system is equipped with a hardware watchdog timer and is running Solaris, the watchdog can be used to supervise the entire system. An Erlang runtime system to be monitored by a heart program, should be started with the command line flag -heart (see also erl(1) . The heart process is then started automatically: % erl -heart ... If the system should be rebooted because of missing heart-beats, or a terminated Erlang runtime system, the environment variable HEART_COM- MAND has to be set before the system is started. If this variable is not set, a warning text will be printed but the system will not reboot. However, if the hardware watchdog is used, it will trigger a reboot HEART_BEAT_BOOT_DELAY seconds later nevertheless (default is 60). To reboot on the WINDOWS platform HEART_COMMAND can be set to heart -shutdown (included in the Erlang delivery) or of course to any other suitable program which can activate a reboot. The hardware watchdog will not be started under Solaris if the environment variable HW_WD_DISABLE is set. The HEART_BEAT_TIMEOUT and HEART_BEAT_BOOT_DELAY environment variables can be used to configure the heart timeouts, they can be set in the operating system shell before Erlang is started or be specified at the command line: % erl -heart -env HEART_BEAT_TIMEOUT 30 ... The value (in seconds) must be in the range 10 < X <= 65535. It should be noted that if the system clock is adjusted with more than HEART_BEAT_TIMEOUT seconds, heart will timeout and try to reboot the system. This can happen, for example, if the system clock is adjusted automatically by use of NTP (Network Time Protocol). In the following descriptions, all function fails with reason badarg if heart is not started. EXPORTS
set_cmd(Cmd) -> ok | {error, {bad_cmd, Cmd}} Types Cmd = string() Sets a temporary reboot command. This command is used if a HEART_COMMAND other than the one specified with the environment variable should be used in order to reboot the system. The new Erlang runtime system will (if it misbehaves) use the environment variable HEART_COMMAND to reboot. Limitations: The length of the Cmd command string must be less than 2047 characters. clear_cmd() -> ok Clears the temporary boot command. If the system terminates, the normal HEART_COMMAND is used to reboot. get_cmd() -> {ok, Cmd} Types Cmd = string() Get the temporary reboot command. If the command is cleared, the empty string will be returned. Ericsson AB kernel 2.14.3 heart(3erl)

Check Out this Related Man Page

erl_prim_loader(3erl)					     Erlang Module Definition					     erl_prim_loader(3erl)

NAME
erl_prim_loader - Low Level Erlang Loader DESCRIPTION
erl_prim_loader is used to load all Erlang modules into the system. The start script is also fetched with this low level loader. erl_prim_loader knows about the environment and how to fetch modules. The loader could, for example, fetch files using the file system (with absolute file names as input), or a database (where the binary format of a module is stored). The -loader Loader command line flag can be used to choose the method used by the erl_prim_loader . Two Loader methods are supported by the Erlang runtime system: efile and inet . If another loader is required, then it has to be implemented by the user. The Loader provided by the user must fulfill the protocol defined below, and it is started with the erl_prim_loader by evaluating open_port({spawn,Loader},[binary]) . Warning: The support for loading of code from archive files is experimental. The sole purpose of releasing it before it is ready is to obtain early feedback. The file format, semantics, interfaces etc. may be changed in a future release. The functions list_dir/1 and read_file_info/1 as well as the flag -loader_debug are also experimental EXPORTS
start(Id, Loader, Hosts) -> {ok, Pid} | {error, What} Types Id = term() Loader = atom() | string() Hosts = [Host] Host = atom() Pid = pid() What = term() Starts the Erlang low level loader. This function is called by the init process (and module). The init process reads the command line flags -id Id , -loader Loader , and -hosts Hosts . These are the arguments supplied to the start/3 function. If -loader is not given, the default loader is efile which tells the system to read from the file system. If -loader is inet , the -id Id , -hosts Hosts , and -setcookie Cookie flags must also be supplied. Hosts identifies hosts which this node can contact in order to load modules. One Erlang runtime system with a erl_boot_server process must be started on each of hosts given in Hosts in order to answer the requests. See erl_boot_server(3erl) . If -loader is something else, the given port program is started. The port program is supposed to follow the protocol specified below. get_file(Filename) -> {ok, Bin, FullName} | error Types Filename = string() Bin = binary() FullName = string() This function fetches a file using the low level loader. Filename is either an absolute file name or just the name of the file, for example "lists.beam" . If an internal path is set to the loader, this path is used to find the file. If a user supplied loader is used, the path can be stripped off if it is obsolete, and the loader does not use a path. FullName is the complete name of the fetched file. Bin is the contents of the file as a binary. The Filename can also be a file in an archive. For example /otp/root/lib/mnesia-4.4.7.ez/mnesia-4.4.7/ebin/mnesia_backup.beam See code(3erl) about archive files. get_path() -> {ok, Path} Types Path = [Dir] Dir = string() This function gets the path set in the loader. The path is set by the init process according to information found in the start script. list_dir(Dir) -> {ok, Filenames} | error Types Dir = name() Filenames = [Filename] Filename = string() Lists all the files in a directory. Returns {ok, Filenames} if successful. Otherwise, it returns error . Filenames is a list of the names of all the files in the directory. The names are not sorted. The Dir can also be a directory in an archive. For example /otp/root/lib/mnesia-4.4.7.ez/mnesia-4.4.7/ebin See code(3erl) about ar- chive files. read_file_info(Filename) -> {ok, FileInfo} | error Types Filename = name() FileInfo = #file_info{} Retrieves information about a file. Returns {ok, FileInfo} if successful, otherwise error . FileInfo is a record file_info , defined in the Kernel include file file.hrl . Include the following directive in the module from which the function is called: -include_lib("kernel/include/file.hrl"). See file(3erl) for more info about the record file_info . The Filename can also be a file in an archive. For example /otp/root/lib/mnesia-4.4.7.ez/mnesia-4.4.7/ebin/mnesia_backup.beam See code(3erl) about archive files. set_path(Path) -> ok Types Path = [Dir] Dir = string() This function sets the path of the loader if init interprets a path command in the start script. PROTOCOL
The following protocol must be followed if a user provided loader port program is used. The Loader port program is started with the command open_port({spawn,Loader},[binary]) . The protocol is as follows: Function Send Receive ------------------------------------------------------------- get_file [102 | FileName] [121 | BinaryFile] (on success) [122] (failure) stop eof terminate COMMAND LINE FLAGS
The erl_prim_loader module interprets the following command line flags: -loader Loader : Specifies the name of the loader used by erl_prim_loader . Loader can be efile (use the local file system), or inet (load using the boot_server on another Erlang node). If Loader is user defined, the defined Loader port program is started. If the -loader flag is omitted, it defaults to efile . -loader_debug : Makes the efile loader write some debug information, such as the reason for failures, while it handles files. -hosts Hosts : Specifies which other Erlang nodes the inet loader can use. This flag is mandatory if the -loader inet flag is present. On each host, there must be on Erlang node with the erl_boot_server which handles the load requests. Hosts is a list of IP addresses (hostnames are not acceptable). -id Id : Specifies the identity of the Erlang runtime system. If the system runs as a distributed node, Id must be identical to the name sup- plied with the -sname or -name distribution flags. -setcookie Cookie : Specifies the cookie of the Erlang runtime system. This flag is mandatory if the -loader inet flag is present. SEE ALSO
init(3erl) , erl_boot_server(3erl) Ericsson AB erts 5.8.3 erl_prim_loader(3erl)
Man Page