slave

MODULE

slave

MODULE SUMMARY

Functions to Starting and Controlling Slave Nodes

DESCRIPTION

This module provides functions for starting Erlang slave nodes.
All slave nodes which are started by a master will terminate
automatically when the master terminates. All TTY output produced
at the slave will be sent back to the master node. File I/O is
done via the master.

Slave nodes on other hosts than the current one are started with
the program rsh. The user must be allowed to rsh to
the remote hosts without being prompted for a password. This can
be arranged in a number of ways (refer to the rsh
documentation for details). A slave node started on the same host
as the master inherits certain environment values from the master,
such as the current directory and the environment variables. For
what can be assumed about the environment when a slave is started
on another host, read the documentation for the rsh
program.

An alternative to the rsh program can be specified on
the command line to erl as follows: -rsh Program.

The slave node should use the same file system at the master. At
least, Erlang/OTP should be installed in the same place on both
computers and the same version of Erlang should be used.

Currently, a node running on Windows NT can only start slave
nodes on the host on which it is running.

The master node must be alive.

EXPORTS

Starts a slave node on the host Host. Host names need
not necessarily be specified as fully qualified names; short
names can also be used. This is the same condition that
applies to names of distributed Erlang nodes.

The name of the started node will be Name@Host. If no
name is provided, the name will be the same as the node which
executes the call (with the exception of the host name part of
the node name).

The slave node resets its user process so that all
terminal I/O which is produced at the slave is automatically
relayed to the master. Also, the file process will be relayed
to the master.

The Args argument is used to set erl command
line arguments. If provided, it is passed to the new node and
can be used for a variety of purposes. See
erl(1)

As an example, suppose that we want to start a slave node at
host H with the node name Name@H, and we also
want the slave node to have the following properties:

directory Dir should be added to the code path;

the Mnesia directory should be set to M;

the unix DISPLAY environment variable should be
set to the display of the master node.

Starts a number of pseudo servers. A pseudo server is a
server with a registered name which does absolutely nothing
but pass on all message to the real server which executes at a
master node. A pseudo server is an intermediary which only has
the same registered name as the real server.

For example, if we have started a slave node N and
want to execute pxw graphics code on this node, we can
start the server pxw_server as a pseudo server at
the slave node. The following code illustrates: