From cb9eea1db0715cc8c944f54e61270d25502e3163 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Sat, 20 Apr 2013 21:44:09 +0200 Subject: o Exposing 'status' and 'restart' commands again. --- bin/app-restart | 11 +++++++++++ bin/app-status | 11 +++++++++++ libexec/app-operator-pid | 15 ++++++++++++--- libexec/app-resolver-maven | 2 +- 4 files changed, 35 insertions(+), 4 deletions(-) create mode 100755 bin/app-restart create mode 100755 bin/app-status diff --git a/bin/app-restart b/bin/app-restart new file mode 100755 index 0000000..768aea0 --- /dev/null +++ b/bin/app-restart @@ -0,0 +1,11 @@ +#!/bin/bash + +set -e +set -u + +APPSH_HOME=$(cd $(dirname "$0")/.. && pwd) + +. $APPSH_HOME/lib/common +# HEADER END + +exec $APPSH_HOME/libexec/app-operate "restart" "$@" diff --git a/bin/app-status b/bin/app-status new file mode 100755 index 0000000..e36e1d6 --- /dev/null +++ b/bin/app-status @@ -0,0 +1,11 @@ +#!/bin/bash + +set -e +set -u + +APPSH_HOME=$(cd $(dirname "$0")/.. && pwd) + +. $APPSH_HOME/lib/common +# HEADER END + +exec $APPSH_HOME/libexec/app-operate "status" "$@" diff --git a/libexec/app-operator-pid b/libexec/app-operator-pid index dd48979..db1da1f 100755 --- a/libexec/app-operator-pid +++ b/libexec/app-operator-pid @@ -83,14 +83,14 @@ command_stop() { case `do_status` in stopped) echo "The application not running." - exit 1 + return 1 ;; crashed) echo "The application crashed. Was running as $PID" # TODO: should this remove the PID file? That makes it # possible to run "stop" to stop "status" from showing # "crashed". Perhaps just a "clear" goal to clear the pid file. - exit 1 + return 1 ;; esac @@ -140,6 +140,13 @@ command_status() { esac } +command_restart() { + set +e + command_stop + set -e + command_start +} + APP_HOME=${APP_HOME-} if [[ $APP_HOME == "" ]] @@ -158,8 +165,10 @@ fi command="$1" case "$command" in - start|stop|status) + start|stop|status|restart) command_$command + ret=$? + exit $ret ;; *) fatal "Invalid command: $command" diff --git a/libexec/app-resolver-maven b/libexec/app-resolver-maven index 72aa15b..7f01992 100755 --- a/libexec/app-resolver-maven +++ b/libexec/app-resolver-maven @@ -95,7 +95,7 @@ resolve_version() { exit 0 fi - echo "Resolving version $version..." + echo "Resolving Maven version $version..." resolve_snapshot $group_id $artifact_id $version } -- cgit v1.2.3