From 14d719dc08ffada0629194ae871dbb0e0a9d3026 Mon Sep 17 00:00:00 2001 From: Mihai Prica Date: Tue, 11 Jun 2013 14:25:30 +0300 Subject: python-nova: Added initscript Signed-off-by: Mihai Prica --- .../python/python-glance/glance.init | 73 ++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 meta-openstack/recipes-devtools/python/python-glance/glance.init (limited to 'meta-openstack/recipes-devtools/python/python-glance') diff --git a/meta-openstack/recipes-devtools/python/python-glance/glance.init b/meta-openstack/recipes-devtools/python/python-glance/glance.init new file mode 100644 index 0000000..7a269d6 --- /dev/null +++ b/meta-openstack/recipes-devtools/python/python-glance/glance.init @@ -0,0 +1,73 @@ +#!/bin/sh + +### BEGIN INIT INFO +# Provides: +# Required-Start: $remote_fs $network $syslog +# Required-Stop: $remote_fs $syslog +# Default-Stop: 0 1 6 +# Short-Description: Glance API server +# Description: OpenStack Image Service (code-named Glance) API server +### END INIT INFO + +SUFFIX=@suffix@ +DESC="glance-$SUFFIX" +DAEMON="/usr/bin/glance-$SUFFIX" +CONFIG="/etc/glance/glance-$SUFFIX.conf" +PIDFILE="/var/run/glance-$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} \ + -- --config-file $CONFIG + + 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