From 73d5afa1581566b00ae116034c958ab85f5b35fd Mon Sep 17 00:00:00 2001 From: Bruce Ashfield Date: Mon, 18 Nov 2013 14:28:38 -0500 Subject: nova: generate per-service initscripts Rather than use the catch-all "nova-all" initscript, we switch to one initscript per-service. The old nova-all is still installed, but not linked as an initscript, so it can be used as a fallback. In addition to per-service initscripts, we switch to generating those initscripts from a common template script. Signed-off-by: Bruce Ashfield --- .../python/python-nova/nova-compute | 71 --------------------- .../recipes-devtools/python/python-nova/nova.init | 72 ++++++++++++++++++++++ 2 files changed, 72 insertions(+), 71 deletions(-) delete mode 100644 meta-openstack/recipes-devtools/python/python-nova/nova-compute create mode 100644 meta-openstack/recipes-devtools/python/python-nova/nova.init (limited to 'meta-openstack/recipes-devtools/python/python-nova') diff --git a/meta-openstack/recipes-devtools/python/python-nova/nova-compute b/meta-openstack/recipes-devtools/python/python-nova/nova-compute deleted file mode 100644 index 024b099..0000000 --- a/meta-openstack/recipes-devtools/python/python-nova/nova-compute +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/sh - -### BEGIN INIT INFO -# Provides: nova-compute -# Required-Start: $remote_fs $syslog -# Required-Stop: $remote_fs $syslog -# Default-Start: 3 5 -# Default-Stop: 0 1 2 6 -# Short-Description: OpenStack Compute (Nova) - compute -# Description: OpenStack Compute (Nova) - compute -### END INIT INFO - -DESC="nova-compute" -DAEMON="/usr/bin/nova-compute" -PIDFILE="/var/run/nova-compute.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 diff --git a/meta-openstack/recipes-devtools/python/python-nova/nova.init b/meta-openstack/recipes-devtools/python/python-nova/nova.init new file mode 100644 index 0000000..3a2bbac --- /dev/null +++ b/meta-openstack/recipes-devtools/python/python-nova/nova.init @@ -0,0 +1,72 @@ +#!/bin/sh + +### BEGIN INIT INFO +# Provides: nova-compute +# Required-Start: $remote_fs $syslog +# Required-Stop: $remote_fs $syslog +# Default-Start: 3 5 +# Default-Stop: 0 1 2 6 +# Short-Description: OpenStack Compute (Nova) - @suffix@ +# Description: OpenStack Compute (Nova) - @suffix@ +### END INIT INFO + +SUFFIX="@suffix@" +DESC="nova-@suffix@" +DAEMON="/usr/bin/nova-$SUFFIX" +PIDFILE="/var/run/nova-$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