summaryrefslogtreecommitdiff
path: root/priv
diff options
context:
space:
mode:
authorjoewilliams <williams.joe@gmail.com>2012-04-10 11:32:53 -0700
committerjoewilliams <williams.joe@gmail.com>2012-04-10 17:34:00 -0700
commitbdc1a85239603d1213ff80f927edd9aa280a9590 (patch)
treeea53fb79995682276b9f7c071b9af9390424a5e7 /priv
parent7864b81e2dea48c28401d6876a01f9c483633485 (diff)
Add foreground as a runner start option
Diffstat (limited to 'priv')
-rwxr-xr-xpriv/templates/simplenode.runner27
1 files changed, 26 insertions, 1 deletions
diff --git a/priv/templates/simplenode.runner b/priv/templates/simplenode.runner
index 693c8ec..f6d3f6c 100755
--- a/priv/templates/simplenode.runner
+++ b/priv/templates/simplenode.runner
@@ -178,8 +178,33 @@ case "$1" in
exec $CMD -- ${1+"$@"}
;;
+ foreground)
+ # start up the release in the foreground for use by runit
+ # or other supervision services
+
+ BOOTFILE=$SCRIPT
+ FOREGROUNDOPTIONS="-noinput +Bd"
+
+ # Setup beam-required vars
+ ROOTDIR=$RUNNER_BASE_DIR
+ BINDIR=$ROOTDIR/erts-$ERTS_VSN/bin
+ EMU=beam
+ PROGNAME=`echo $0 | sed 's/.*\///'`
+ CMD="$BINDIR/erlexec $FOREGROUNDOPTIONS -boot $RUNNER_BASE_DIR/releases/$APP_VSN/$BOOTFILE -config $CONFIG_PATH -args_file $VMARGS_PATH"
+ export EMU
+ export ROOTDIR
+ export BINDIR
+ export PROGNAME
+
+ # Dump environment info for logging purposes
+ echo "Exec: $CMD" -- ${1+"$@"}
+ echo "Root: $ROOTDIR"
+
+ # Start the VM
+ exec $CMD -- ${1+"$@"}
+ ;;
*)
- echo "Usage: $SCRIPT {start|stop|restart|reboot|ping|console|console_clean|attach}"
+ echo "Usage: $SCRIPT {start|foreground|stop|restart|reboot|ping|console|console_clean|attach}"
exit 1
;;
esac