summaryrefslogtreecommitdiffstats
path: root/compass-deck/bin/compassd
diff options
context:
space:
mode:
authorJustin chi <chigang@huawei.com>2017-11-03 08:48:34 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-11-03 08:48:34 +0000
commitcdbfdcb04670bba08b301789c6be08900da44f10 (patch)
treee2d20371b26863551ef6907601d06a538d8eea45 /compass-deck/bin/compassd
parent651da345e4fde74f81213fd08cc3a21a8421089a (diff)
parent905b0231e93ce2409a45dd6c4f5f983689fdb790 (diff)
Merge "Add compass-deck"
Diffstat (limited to 'compass-deck/bin/compassd')
-rwxr-xr-xcompass-deck/bin/compassd43
1 files changed, 43 insertions, 0 deletions
diff --git a/compass-deck/bin/compassd b/compass-deck/bin/compassd
new file mode 100755
index 0000000..fc77bb9
--- /dev/null
+++ b/compass-deck/bin/compassd
@@ -0,0 +1,43 @@
+#!/bin/sh
+
+RETVAL_CELERY=0
+RETVAL_PROGRESS_UPDATE=0
+start() {
+ service compass-celeryd start
+ RETVAL_CELERY=$?
+ service compass-progress-updated start
+ RETVAL_PROGRESS_UPDATE=$?
+}
+
+stop() {
+ service compass-celeryd stop
+ RETVAL_CELERY=$?
+ service compass-progress-updated stop
+ RETVAL_PROGRESS_UPDATE=$?
+}
+
+restart() {
+ stop
+ start
+}
+case "$1" in
+ start|stop|restart)
+ $1
+ ;;
+ status)
+ service compass-celeryd status
+ RETVAL_CELERY=$?
+ service compass-progress-updated status
+ RETVAL_PROGRESS_UPDATE=$?
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|status|restart}"
+ exit 1
+ ;;
+esac
+if [[ "$RETVAL_CELERY" != "0" ]]; then
+ exit $RETVAL_CELERY
+fi
+if [[ "$RETVAL_PROGRESS_UPDATE" != "0" ]]; then
+ exit $RETVAL_PROGRESS_UPDATE
+fi