summaryrefslogtreecommitdiffstats
path: root/meta-openstack/recipes-devtools/python/python-cinder/cinder.init
diff options
context:
space:
mode:
authorMihai Prica <prica.mihai@gmail.com>2013-06-11 14:47:55 +0300
committerBruce Ashfield <bruce.ashfield@windriver.com>2013-08-28 18:41:56 -0400
commit6ca32d280bb519097b3356037aff5c76a7c11b7a (patch)
tree1a4542e36617d88b71f8d13c7623b6fca54f9296 /meta-openstack/recipes-devtools/python/python-cinder/cinder.init
parentb72360be0414ce6f9c7dba877617ef336034109d (diff)
downloadmeta-cloud-services-6ca32d280bb519097b3356037aff5c76a7c11b7a.tar.gz
python-cinder: added 2013.1.1
-Added configuration files with necessary credentials; -Added initscript to start cinder-api and cinder-volume; Signed-off-by: Mihai Prica <prica.mihai@gmail.com>
Diffstat (limited to 'meta-openstack/recipes-devtools/python/python-cinder/cinder.init')
-rw-r--r--meta-openstack/recipes-devtools/python/python-cinder/cinder.init74
1 files changed, 74 insertions, 0 deletions
diff --git a/meta-openstack/recipes-devtools/python/python-cinder/cinder.init b/meta-openstack/recipes-devtools/python/python-cinder/cinder.init
new file mode 100644
index 0000000..7ae3dbf
--- /dev/null
+++ b/meta-openstack/recipes-devtools/python/python-cinder/cinder.init
@@ -0,0 +1,74 @@
1#!/bin/sh
2
3### BEGIN INIT INFO
4# Provides: cinder-api
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 (Cinder) - API
12# Description: OpenStack Block Storage (Cinder) - API
13### END INIT INFO
14
15SUFFIX=@suffix@
16DESC="cinder-$SUFFIX"
17DAEMON="/usr/bin/cinder-$SUFFIX"
18PIDFILE="/var/run/cinder-$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 echo -n "Starting $DESC..."
34
35 start-stop-daemon --start --quiet --background \
36 --pidfile ${PIDFILE} --make-pidfile --exec ${DAEMON}
37
38 if [ $? -eq 0 ]; then
39 echo "done."
40 else
41 echo "failed."
42 fi
43}
44
45stop()
46{
47 echo -n "Stopping $DESC..."
48 start-stop-daemon --stop --quiet --pidfile $PIDFILE
49 if [ $? -eq 0 ]; then
50 echo "done."
51 else
52 echo "failed."
53 fi
54 rm -f $PIDFILE
55}
56
57case "$1" in
58 start)
59 start
60 ;;
61 stop)
62 stop
63 ;;
64 restart|force-reload)
65 stop
66 start
67 ;;
68 *)
69 echo "Usage: $0 {start|stop|force-reload|restart}"
70 exit 1
71 ;;
72esac
73
74exit 0