EpmdUp (EpmdUp v1.0.2)

View Source

A simple Elixir module to check and manage the Erlang Port Mapper Daemon (epmd).

Summary

Functions

Starts the Erlang Port Mapper Daemon (epmd) if it's not already running.

Checks if the Erlang Port Mapper Daemon (epmd) is active and accepting connections.

Stops the Erlang Port Mapper Daemon (epmd) using Kill EPMD if it's running

Finds the full path of the Erlang Port Mapper Daemon (epmd) executable in the system.

Functions

activate()

@spec activate() :: :ok | {:error, term()}

Starts the Erlang Port Mapper Daemon (epmd) if it's not already running.

active?()

@spec active?() :: boolean()

Checks if the Erlang Port Mapper Daemon (epmd) is active and accepting connections.

This function attempts to establish a TCP connection to the epmd port (4369) on localhost. If the connection is successful, it means epmd is running and accepting connections.

Returns

  • true - if epmd is active and accepting connections
  • false - if epmd is not running or not accepting connections

deactivate()

@spec deactivate() :: :ok | {:error, term()}

Stops the Erlang Port Mapper Daemon (epmd) using Kill EPMD if it's running

find_epmd_executable()

@spec find_epmd_executable() :: binary() | nil

Finds the full path of the Erlang Port Mapper Daemon (epmd) executable in the system.

Returns nil if the executable cannot be found in the system's PATH.