diff options
author | Andrew Thompson <andrew@hijacked.us> | 2011-07-07 11:53:01 -0400 |
---|---|---|
committer | Tuncer Ayaz <tuncer.ayaz@gmail.com> | 2011-07-13 17:59:49 +0200 |
commit | 6749bb6ac0a41bcdfc8bdfa1141b01acd6154a73 (patch) | |
tree | 8400eb41219ad6faf721ec3df9b7025f82539f46 | |
parent | c63002bef873d2b1ec963a4931b43b45cef758ba (diff) |
Propagate exit status from nodetool to runner script
-rwxr-xr-x | priv/templates/simplenode.runner | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/priv/templates/simplenode.runner b/priv/templates/simplenode.runner index 59e3973..87947a4 100755 --- a/priv/templates/simplenode.runner +++ b/priv/templates/simplenode.runner @@ -85,6 +85,10 @@ case "$1" in ;; esac $NODETOOL stop + ES=$? + if [ "$ES" -ne 0 ]; then + exit $ES + fi while `kill -0 $PID 2>/dev/null`; do sleep 1 @@ -94,28 +98,41 @@ case "$1" in restart) ## Restart the VM without exiting the process $NODETOOL restart + ES=$? + if [ "$ES" -ne 0 ]; then + exit $ES + fi ;; reboot) ## Restart the VM completely (uses heart to restart it) $NODETOOL reboot + ES=$? + if [ "$ES" -ne 0 ]; then + exit $ES + fi ;; ping) ## See if the VM is alive $NODETOOL ping + ES=$? + if [ "$ES" -ne 0 ]; then + exit $ES + fi ;; attach) # Make sure a node IS running RES=`$NODETOOL ping` - if [ "$RES" != "pong" ]; then + ES=$? + if [ "$ES" -ne 0 ]; then echo "Node is not running!" - exit 1 + exit $ES fi shift - $ERTS_PATH/to_erl $PIPE_DIR + exec $ERTS_PATH/to_erl $PIPE_DIR ;; console|console_clean) |