summaryrefslogtreecommitdiffstats
path: root/meta-openstack/recipes-devtools/python/python-rally/rally.init
diff options
context:
space:
mode:
authorVu Tran <vu.tran@windriver.com>2014-07-10 10:23:42 -0400
committerBruce Ashfield <bruce.ashfield@windriver.com>2014-07-17 00:14:05 -0400
commit526542c36d53d24c786a1d2e481176899f20bdff (patch)
tree51bd94562e634c777b8409d953e91ff9866c6ebb /meta-openstack/recipes-devtools/python/python-rally/rally.init
parent101462906de023d9a55800979986a509fa7a9347 (diff)
downloadmeta-cloud-services-526542c36d53d24c786a1d2e481176899f20bdff.tar.gz
introduce openstack Rally component
* Add Rally bb file * Add Rally deployment json config for existing deployment * Add task example * To use custom Rally config file Signed-off-by: Vu Tran <vu.tran@windriver.com>
Diffstat (limited to 'meta-openstack/recipes-devtools/python/python-rally/rally.init')
-rw-r--r--meta-openstack/recipes-devtools/python/python-rally/rally.init95
1 files changed, 95 insertions, 0 deletions
diff --git a/meta-openstack/recipes-devtools/python/python-rally/rally.init b/meta-openstack/recipes-devtools/python/python-rally/rally.init
new file mode 100644
index 0000000..e834547
--- /dev/null
+++ b/meta-openstack/recipes-devtools/python/python-rally/rally.init
@@ -0,0 +1,95 @@
1#!/bin/sh
2
3### BEGIN INIT INFO
4# Provides: rally
5# Required-Start: $remote_fs $syslog
6# Required-Stop: $remote_fs $syslog
7# Should-Start: postgresql rabbitmq-server
8# Should-Stop: postgresql rabbitmq-server
9# Default-Start: 3 5
10# Default-Stop: 0 1 2 6
11# Short-Description: OpenStack Block Storage (Rally) - API
12# Description: OpenStack Block Storage (Rally) - API
13### END INIT INFO
14
15SUFFIX=@suffix@
16DESC="rally-$SUFFIX"
17DAEMON="/usr/bin/rally-$SUFFIX"
18PIDFILE="/var/run/rally-$SUFFIX.pid"
19
20start()
21{
22 if [ -e $PIDFILE ]; then
23 PIDDIR=/proc/$(cat $PIDFILE)
24 if [ -d ${PIDDIR} ]; then
25 echo "$DESC already running."
26 exit 1
27 else
28 echo "Removing stale PID file $PIDFILE"
29 rm -f $PIDFILE
30 fi
31 fi
32
33 if [ ! -d /var/log/rally ]; then
34 mkdir /var/log/rally
35 fi
36
37 echo -n "Starting $DESC..."
38
39 start-stop-daemon --start --quiet --background \
40 --pidfile ${PIDFILE} --make-pidfile --exec ${DAEMON} \
41 -- --log-dir=/var/log/rally
42
43 if [ $? -eq 0 ]; then
44 echo "done."
45 else
46 echo "failed."
47 fi
48}
49
50stop()
51{
52 echo -n "Stopping $DESC..."
53 start-stop-daemon --stop --quiet --pidfile $PIDFILE
54 if [ $? -eq 0 ]; then
55 echo "done."
56 else
57 echo "failed."
58 fi
59 rm -f $PIDFILE
60}
61
62status()
63{
64 pid=`cat $PIDFILE 2>/dev/null`
65 if [ -n "$pid" ]; then
66 if ps -p $pid >&- ; then
67 echo "$DESC is running"
68 return
69 fi
70 fi
71 echo "$DESC is not running"
72}
73
74case "$1" in
75 start)
76 start
77 ;;
78 stop)
79 stop
80 ;;
81 restart|force-reload|reload)
82 stop
83 start
84 ;;
85 status)
86 status
87 ;;
88 *)
89 echo "Usage: $0 {start|stop|force-reload|restart|reload|status}"
90 exit 1
91 ;;
92esac
93
94exit 0
95