Skip to content
Browse files

Adds hostname-specific -name argument support to htoad command

  • Loading branch information...
1 parent ca0c5cd commit 92607970b2ec6736bcede989946ff8277e13a3aa Yurii Rashkovskii committed Apr 23, 2012
Showing with 6 additions and 9 deletions.
  1. +6 −6 rel/files/htoad
  2. +0 −3 rel/files/vm.args
View
12 rel/files/htoad
@@ -44,13 +44,13 @@ else
CONFIG_PATH="$RUNNER_ETC_DIR/app.config"
fi
-# Extract the target node name from node.args
-NAME_ARG=`egrep '^-s?name' $VMARGS_PATH`
-if [ -z "$NAME_ARG" ]; then
- echo "vm.args needs to have either -name or -sname parameter."
- exit 1
+if [ -z "$HOSTNAME" ]; then
+ HOSTNAME=`hostname`
fi
+NODE=htoad@$HOSTNAME
+NAME_ARG="-name htoad@$HOSTNAME"
+
# Extract the target cookie
COOKIE_ARG=`grep '^-setcookie' $VMARGS_PATH`
if [ -z "$COOKIE_ARG" ]; then
@@ -73,7 +73,7 @@ EMU=beam
PROGNAME=`echo $0 | sed 's/.*\\///'`
EXTRA_ARGS=$*
-CMD="$BINDIR/erlexec -boot $RUNNER_BASE_DIR/releases/$APP_VSN/$BOOTFILE -noshell -mode embedded -config $CONFIG_PATH -args_file $VMARGS_PATH -extra $EXTRA_ARGS"
+CMD="$BINDIR/erlexec -boot $RUNNER_BASE_DIR/releases/$APP_VSN/$BOOTFILE -noshell -mode embedded -config $CONFIG_PATH $NAME_ARG -args_file $VMARGS_PATH -extra $EXTRA_ARGS"
export EMU
export ROOTDIR
export BINDIR
View
3 rel/files/vm.args
@@ -1,6 +1,3 @@
-## Name of the node
--name htoad@127.0.0.1
-
## Cookie for distributed erlang
-setcookie htoad

0 comments on commit 9260797

Please sign in to comment.
Something went wrong with that request. Please try again.