Thomas Vachuska
Committed by Gerrit Code Review

Added onos-die command and added some info output to onos-kill command.

Change-Id: I32968907b5f69a334d82048658210e08b109ba23
1 +#!/bin/bash
2 +# -----------------------------------------------------------------------------
3 +# Remotely kills and stops the ONOS service on the specified node.
4 +# -----------------------------------------------------------------------------
5 +
6 +onos-kill "${1:-$OCI}" && onos-service "${1:-$OCI}" stop
...@@ -6,4 +6,13 @@ ...@@ -6,4 +6,13 @@
6 [ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1 6 [ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
7 . $ONOS_ROOT/tools/build/envDefaults 7 . $ONOS_ROOT/tools/build/envDefaults
8 8
9 -ssh $ONOS_USER@${1:-$OCI} "kill -9 \$(ps -ef | grep karaf.jar | grep -v grep | cut -c10-15)" 9 +ssh $ONOS_USER@${1:-$OCI} "
10 + pid=\$(ps -ef | grep karaf.jar | grep -v grep | cut -c10-15 | tr -d ' ')
11 + if [ -n \"\$pid\" ]; then
12 + echo \"Killing ONOS process \$pid on \$(hostname)...\"
13 + kill -9 \$pid
14 + else
15 + echo \"ONOS process is not running...\"
16 + exit 1
17 + fi
18 +"
......