erlaunch

NAME

erlaunch - efficiently execute selected Erlang functions from command line

SYNOPSIS

erlaunch [-p port] [-s shell] [-f] [-c cookie] start
erlaunch [-h host] [-p port] [-s shell] [-f] -c cookie connect
erlaunch status
erlaunch command {argument}

DESCRIPTION

erlaunch start spawns a detached Erlang/OTP BEAM emulator, sets the environment variables ERLAUNCH_HOST, ERLAUNCH_PORT, and ERLAUNCH_COOKIE to refer to that emulator, and starts a subshell. When the subshell is exited, the emulator exits as well.

erlaunch connect connects to an existing emulator, setting the environment variables as erlaunch start.

erlaunch status reports whether a detached emulator is running based on the current settings of environment variables.

erlaunch command arg1 arg2 ... argN looks up the environment variables set by a previous erlaunch start or erlaunch connect, uses them to establish a TCP/IP dialogue with the emulator, and asks the emulator to execute the given command with the given arguments.

OPTIONS

CONFIGURATION

See the example priv/erlaunch.cmds file.

SEE ALSO

erl_call(1), escript(1)

BUGS

Assuredly many.

Ideally, the erlaunch client should contain a break handler that sends an end-of-file condition to the server when interrupted.

It would be very nice to be able to determine whether the server was launched sucessfully before starting the subshell.

erlaunch should be able to determine command from argv[0], so that different symbolic links pointing to the erlaunch executable can invoke different commands.

-h, -p, and -c options are probably sensible in combination with erlaunch command {argument}, but they do not currently have any effect.

send_array is particularly inefficient on both ends. A future version might coalesce the entire array into a single packet.

The protocol could be optimized by having each command say whether it needs arguments, the current working directory, or the environment, and only transferring over the TCP/IP connection, those which are actually needed by the command.