From 6ca32d280bb519097b3356037aff5c76a7c11b7a Mon Sep 17 00:00:00 2001 From: Mihai Prica Date: Tue, 11 Jun 2013 14:47:55 +0300 Subject: 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 --- .../python/python-cinder/cinder.init | 74 ++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 meta-openstack/recipes-devtools/python/python-cinder/cinder.init (limited to 'meta-openstack/recipes-devtools/python/python-cinder/cinder.init') 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 @@ +#!/bin/sh + +### BEGIN INIT INFO +# Provides: cinder-api +# Required-Start: $remote_fs $syslog +# Required-Stop: $remote_fs $syslog +# Should-Start: postgresql rabbitmq-server +# Should-Stop: postgresql rabbitmq-server +# Default-Start: 3 5 +# Default-Stop: 0 1 2 6 +# Short-Description: OpenStack Block Storage (Cinder) - API +# Description: OpenStack Block Storage (Cinder) - API +### END INIT INFO + +SUFFIX=@suffix@ +DESC="cinder-$SUFFIX" +DAEMON="/usr/bin/cinder-$SUFFIX" +PIDFILE="/var/run/cinder-$SUFFIX.pid" + +start() +{ + if [ -e $PIDFILE ]; then + PIDDIR=/proc/$(cat $PIDFILE) + if [ -d ${PIDDIR} ]; then + echo "$DESC already running." + exit 1 + else + echo "Removing stale PID file $PIDFILE" + rm -f $PIDFILE + fi + fi + + echo -n "Starting $DESC..." + + start-stop-daemon --start --quiet --background \ + --pidfile ${PIDFILE} --make-pidfile --exec ${DAEMON} + + if [ $? -eq 0 ]; then + echo "done." + else + echo "failed." + fi +} + +stop() +{ + echo -n "Stopping $DESC..." + start-stop-daemon --stop --quiet --pidfile $PIDFILE + if [ $? -eq 0 ]; then + echo "done." + else + echo "failed." + fi + rm -f $PIDFILE +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart|force-reload) + stop + start + ;; + *) + echo "Usage: $0 {start|stop|force-reload|restart}" + exit 1 + ;; +esac + +exit 0 -- cgit v1.2.3-54-g00ecf