summaryrefslogtreecommitdiffstats
path: root/deploy/adapters/ansible/roles/odl_cluster/templates/opendaylight
diff options
context:
space:
mode:
authorchenshuai@huawei.com <chenshuai@huawei.com>2015-09-23 09:20:08 +0000
committerGerrit Code Review <gerrit@172.30.200.206>2015-09-23 09:20:08 +0000
commit1d49ac0f9c5865399d7ba13fcd201801c2838f03 (patch)
tree6f5ded9fe52d903645a89568da3c665d48c3af27 /deploy/adapters/ansible/roles/odl_cluster/templates/opendaylight
parent7d95e981d3685795620443083385e00ab1ccd3f0 (diff)
parenta1ca02965958c3db9cc093291188e8d6100c24d9 (diff)
Merge "change ODL service script for Centos"
Diffstat (limited to 'deploy/adapters/ansible/roles/odl_cluster/templates/opendaylight')
-rwxr-xr-xdeploy/adapters/ansible/roles/odl_cluster/templates/opendaylight31
1 files changed, 31 insertions, 0 deletions
diff --git a/deploy/adapters/ansible/roles/odl_cluster/templates/opendaylight b/deploy/adapters/ansible/roles/odl_cluster/templates/opendaylight
new file mode 100755
index 00000000..90a267d6
--- /dev/null
+++ b/deploy/adapters/ansible/roles/odl_cluster/templates/opendaylight
@@ -0,0 +1,31 @@
+#!/bin/bash
+# chkconfig: 345 98 2
+# description: ODL controller
+# OpenDaylight service controller script
+export JAVA_HOME=/usr/lib/jvm/java-8-oracle
+USER=odl
+
+cd /opt/opendaylight-0.3.0
+case "$1" in
+ start)
+ /bin/su -m $USER -s /bin/bash -c ./bin/start
+ ;;
+ stop)
+ /bin/su -m $USER -s /bin/bash -c ./bin/stop
+ ;;
+ status)
+ PID=`ps aux | grep java | grep karaf | awk '{print $2}'`
+ if test -z $PID
+ then
+ echo "ODL is down..."
+ exit 1
+ else
+ echo "ODL is running... PID $PID"
+ exit 0
+ fi
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|status}"
+ exit 1
+ ;;
+esac