.TH epmd 1 "erts 6.2" "Ericsson AB" "User Commands" .SH NAME epmd \- Erlang Port Mapper Daemonepmd [-d|-debug] [DbgExtra...] [-port No] [-daemon] [-relaxed_command_check]Starts the port mapper daemonepmd [-d|-debug] [-port No] [-names|-kill|-stop Name]Communicates with a running port mapper daemon .SH DESCRIPTION .LP This daemon acts as a name server on all hosts involved in distributed Erlang computations\&. When an Erlang node starts, the node has a name and it obtains an address from the host OS kernel\&. The name and the address are sent to the \fIepmd\fR\& daemon running on the local host\&. In a TCP/IP environment, the address consists of the IP address and a port number\&. The name of the node is an atom on the form of \fIName@Node\fR\&\&. The job of the \fIepmd\fR\& daemon is to keep track of which node name listens on which address\&. Hence, \fIepmd\fR\& maps symbolic node names to machine addresses\&. .LP The TCP/IP \fIepmd\fR\& daemon actually only keeps track of the \fIName\fR\& (first) part of an Erlang node name\&. The \fIHost\fR\& part (whatever is after the \fI@\fR\&) is implicit in the node name where the \fIepmd\fR\& daemon was actually contacted, as is the IP address where the Erlang node can be reached\&. Consistent and correct TCP naming services are therefore required for an Erlang network to function correctly\&. .RS 2 .TP 2 .B Starting the port mapper daemon: The daemon is started automatically by the \fIerl\fR\& command if the node is to be distributed and there is no running instance present\&. If automatically launched, environment variables have to be used to alter the behavior of the daemon\&. See the \fBEnvironment variables\fR\& section below\&. .RS 2 .LP If the -daemon argument is not given, \fIepmd\fR\& runs as a normal program with the controlling terminal of the shell in which it is started\&. Normally, it should run as a daemon\&. .RE .RS 2 .LP Regular start-up options are described in the \fBRegular options\fR\& section below\&. .RE .RS 2 .LP The \fIDbgExtra\fR\& options are described in the \fBDbgExtra options\fR\& section below\&. .RE .TP 2 .B Communicating with a running port mapper daemon: Communicating with the running epmd daemon by means of the \fIepmd\fR\& program is done primarily for debugging purposes\&. .RS 2 .LP The different queries are described in the \fBInteractive options\fR\& section below\&. .RE .RE .SH "REGULAR OPTIONS" .LP These options are available when starting the actual name server\&. The name server is normally started automatically by the \fIerl\fR\& command (if not already available), but it can also be started at i\&.e\&. system start-up\&. .RS 2 .TP 2 .B \fI-address List\fR\&: Let this instance of \fIepmd\fR\& listen only on the comma-separated list of IP addresses and on the loopback address (which is implicitly added to the list if it has not been specified)\&. This can also be set using the \fIERL_EPMD_ADDRESS\fR\& environment variable\&. See the section \fBEnvironment variables\fR\& below\&. .TP 2 .B \fI-port No\fR\&: Let this instance of epmd listen to another TCP port than default 4369\&. This can also be set using the \fIERL_EPMD_PORT\fR\& environment variable\&. See the section \fBEnvironment variables\fR\& below .TP 2 .B \fI-d | -debug\fR\&: Enable debug output\&. The more \fI-d\fR\& flags given, the more debug output you will get (to a certain limit)\&. This option is most useful when the epmd daemon is not started as a daemon\&. .TP 2 .B \fI-daemon\fR\&: Start epmd detached from the controlling terminal\&. Logging will end up in syslog when available and correctly configured\&. If the epmd daemon is started at boot, this option should definitely be used\&. It is also used when the \fIerl\fR\& command automatically starts \fIepmd\fR\&\&. .TP 2 .B \fI-relaxed_command_check\fR\&: Start the epmd program with relaxed command checking (mostly for backward compatibility)\&. This affects the following: .RS 2 .TP 2 * With relaxed command checking, the \fIepmd\fR\& daemon can be killed from the localhost with i\&.e\&. \fIepmd -kill\fR\& even if there are active nodes registered\&. Normally only daemons with an empty node database can be killed with the \fIepmd -kill\fR\& command\&. .LP .TP 2 * The \fIepmd -stop\fR\& command (and the corresponding messages to epmd, as can be given using \fIerl_interface/ei\fR\&) is normally always ignored, as it opens up the possibility of a strange situation where two nodes of the same name can be alive at the same time\&. A node unregisters itself by just closing the connection to epmd, which is why the \fIstop\fR\& command was only intended for use in debugging situations\&. .RS 2 .LP With relaxed command checking enabled, you can forcibly unregister live nodes\&. .RE .LP .RE .RS 2 .LP Relaxed command checking can also be enabled by setting the environment variable \fIERL_EPMD_RELAXED_COMMAND_CHECK\fR\& prior to starting \fIepmd\fR\&\&. .RE .RS 2 .LP Only use relaxed command checking on systems with very limited interactive usage\&. .RE .RE .SH "DBGEXTRA OPTIONS" .LP These options are purely for debugging and testing epmd clients\&. They should not be used in normal operation\&. .RS 2 .TP 2 .B \fI-packet_timeout Seconds\fR\&: Set the number of seconds a connection can be inactive before epmd times out and closes the connection (default 60)\&. .TP 2 .B \fI-delay_accept Seconds\fR\&: To simulate a busy server you can insert a delay between when epmd gets notified that a new connection is requested and when the connection gets accepted\&. .TP 2 .B \fI-delay_write Seconds\fR\&: Also a simulation of a busy server\&. Inserts a delay before a reply is sent\&. .RE .SH "INTERACTIVE OPTIONS" .LP These options make \fIepmd\fR\& run as an interactive command, displaying the results of sending queries to an already running instance of \fIepmd\fR\&\&. The epmd contacted is always on the local node, but the \fI-port\fR\& option can be used to select between instances if several are running using different ports on the host\&. .RS 2 .TP 2 .B \fI-port No\fR\&: Contacts the \fIepmd\fR\& listening on the given TCP port number (default 4369)\&. This can also be set using the \fIERL_EPMD_PORT\fR\& environment variable\&. See the section \fBEnvironment variables\fR\& below\&. .TP 2 .B \fI-names\fR\&: List names registered with the currently running epmd .TP 2 .B \fI-kill\fR\&: Kill the currently running \fIepmd\fR\&\&. .RS 2 .LP Killing the running \fIepmd\fR\& is only allowed if \fIepmd -names\fR\& shows an empty database or \fI-relaxed_command_check\fR\& was given when the running instance of \fIepmd\fR\& was started\&. Note that \fI-relaxed_command_check\fR\& is given when starting the daemon that is to accept killing when it has live nodes registered\&. When running epmd interactively, \fI-relaxed_command_check\fR\& has no effect\&. A daemon that is started without relaxed command checking has to be killed using i\&.e\&. signals or some other OS specific method if it has active clients registered\&. .RE .TP 2 .B \fI-stop Name\fR\&: Forcibly unregister a live node from \fIepmd\fR\&\&'s database .RS 2 .LP This command can only be used when contacting \fIepmd\fR\& instances started with the \fI-relaxed_command_check\fR\& flag\&. Note that relaxed command checking has to be enabled for the \fIepmd\fR\& daemon contacted\&. When running epmd interactively, \fI-relaxed_command_check\fR\& has no effect\&. .RE .RE .SH "ENVIRONMENT VARIABLES" .RS 2 .TP 2 .B \fIERL_EPMD_ADDRESS\fR\&: This environment variable may be set to a comma-separated list of IP addresses, in which case the \fIepmd\fR\& daemon will listen only on the specified address(es) and on the loopback address (which is implicitly added to the list if it has not been specified)\&. The default behaviour is to listen on all available IP addresses\&. .TP 2 .B \fIERL_EPMD_PORT\fR\&: This environment variable can contain the port number epmd will use\&. The default port will work fine in most cases\&. A different port can be specified to allow several instances of epmd, representing independent clusters of nodes, to co-exist on the same host\&. All nodes in a cluster must use the same epmd port number\&. .TP 2 .B \fIERL_EPMD_RELAXED_COMMAND_CHECK\fR\&: If set prior to start, the \fIepmd\fR\& daemon will behave as if the \fI-relaxed_command_check\fR\& option was given at start-up\&. Consequently, if this option is set before starting the Erlang virtual machine, the automatically started \fIepmd\fR\& will accept the \fI-kill\fR\& and \fI-stop\fR\& commands without restrictions\&. .RE .SH "LOGGING" .LP On some operating systems \fIsyslog\fR\& will be used for error reporting when epmd runs as an daemon\&. To enable the error logging you have to edit /etc/syslog\&.conf file and add an entry .LP .nf !epmd *.*/var/log/epmd.log .fi .LP where are at least one real tab character\&. Spaces will silently be ignored\&. .SH "ACCESS RESTRICTIONS" .LP The \fIepmd\fR\& daemon accepts messages from both localhost and remote hosts\&. However, only the query commands are answered (and acted upon) if the query comes from a remote host\&. It is always an error to try to register a nodename if the client is not a process located on the same host as the \fIepmd\fR\& instance is running on- such requests are considered hostile and the connection is immediately closed\&. .LP The queries accepted from remote nodes are: .RS 2 .TP 2 * Port queries - i\&.e\&. on which port does the node with a given name listen .LP .TP 2 * Name listing - i\&.e\&. give a list of all names registered on the host .LP .RE .LP To restrict access further, firewall software has to be used\&.