[openstack-nova/el6: 13/13] Switch back to SysV init for el6

Mark McLoughlin markmc at fedoraproject.org
Fri Oct 21 10:34:47 UTC 2011


commit 6312246aa323e797050250fa6fb52fe553657f50
Author: Mark McLoughlin <markmc at redhat.com>
Date:   Fri Oct 21 11:31:42 2011 +0100

    Switch back to SysV init for el6
    
    Revert "Switch from SysV init scripts to systemd units"
    
    This reverts commit 808a5de81446e900744211ab1b7cbcd9daa247b4.

 openstack-nova-ajax-console-proxy.init    |  102 +++++++++++++++++++++++++
 openstack-nova-ajax-console-proxy.service |   12 ---
 openstack-nova-api.init                   |  110 +++++++++++++++++++++++++++
 openstack-nova-api.service                |   12 ---
 openstack-nova-compute.init               |  118 +++++++++++++++++++++++++++++
 openstack-nova-compute.service            |   12 ---
 openstack-nova-direct-api.init            |  110 +++++++++++++++++++++++++++
 openstack-nova-direct-api.service         |   12 ---
 openstack-nova-network.init               |  116 ++++++++++++++++++++++++++++
 openstack-nova-network.service            |   12 ---
 openstack-nova-objectstore.init           |  102 +++++++++++++++++++++++++
 openstack-nova-objectstore.service        |   12 ---
 openstack-nova-scheduler.init             |  102 +++++++++++++++++++++++++
 openstack-nova-scheduler.service          |   12 ---
 openstack-nova-vncproxy.init              |  102 +++++++++++++++++++++++++
 openstack-nova-vncproxy.service           |   12 ---
 openstack-nova-volume.init                |  110 +++++++++++++++++++++++++++
 openstack-nova-volume.service             |   12 ---
 openstack-nova.spec                       |   63 +++++++--------
 19 files changed, 1002 insertions(+), 141 deletions(-)
---
diff --git a/openstack-nova-ajax-console-proxy.init b/openstack-nova-ajax-console-proxy.init
new file mode 100644
index 0000000..30a4669
--- /dev/null
+++ b/openstack-nova-ajax-console-proxy.init
@@ -0,0 +1,102 @@
+#!/bin/sh
+#
+# openstack-nova-ajax-console-proxy  OpenStack Nova web-based serial console proxy
+#
+# chkconfig:   - 20 80
+# description: OpenStack Nova web-based serial console proxy
+
+### BEGIN INIT INFO
+# Provides:
+# Required-Start: $remote_fs $network $syslog
+# Required-Stop: $remote_fs $syslog
+# Default-Stop: 0 1 6
+# Short-Description: OpenStack Nova web-based serial console proxy
+# Description: OpenStack Nova web-based serial console proxy
+### END INIT INFO
+
+. /etc/rc.d/init.d/functions
+
+suffix=ajax-console-proxy
+prog=openstack-nova-$suffix
+exec="/usr/bin/nova-$suffix"
+config="/etc/nova/nova.conf"
+pidfile="/var/run/nova/nova-$suffix.pid"
+logfile="/var/log/nova/$suffix.log"
+
+[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
+
+lockfile=/var/lock/subsys/$prog
+
+start() {
+    [ -x $exec ] || exit 5
+    [ -f $config ] || exit 6
+    echo -n $"Starting $prog: "
+    daemon --user nova --pidfile $pidfile "$exec --flagfile $config --logfile $logfile &>/dev/null & echo \$! > $pidfile"
+    retval=$?
+    echo
+    [ $retval -eq 0 ] && touch $lockfile
+    return $retval
+}
+
+stop() {
+    echo -n $"Stopping $prog: "
+    killproc -p $pidfile $prog
+    retval=$?
+    echo
+    [ $retval -eq 0 ] && rm -f $lockfile
+    return $retval
+}
+
+restart() {
+    stop
+    start
+}
+
+reload() {
+    restart
+}
+
+force_reload() {
+    restart
+}
+
+rh_status() {
+    status -p $pidfile $prog
+}
+
+rh_status_q() {
+    rh_status >/dev/null 2>&1
+}
+
+
+case "$1" in
+    start)
+        rh_status_q && exit 0
+        $1
+        ;;
+    stop)
+        rh_status_q || exit 0
+        $1
+        ;;
+    restart)
+        $1
+        ;;
+    reload)
+        rh_status_q || exit 7
+        $1
+        ;;
+    force-reload)
+        force_reload
+        ;;
+    status)
+        rh_status
+        ;;
+    condrestart|try-restart)
+        rh_status_q || exit 0
+        restart
+        ;;
+    *)
+        echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
+        exit 2
+esac
+exit $?
diff --git a/openstack-nova-api.init b/openstack-nova-api.init
new file mode 100644
index 0000000..d97ed4d
--- /dev/null
+++ b/openstack-nova-api.init
@@ -0,0 +1,110 @@
+#!/bin/sh
+#
+# openstack-nova-api  OpenStack Nova API Server
+#
+# chkconfig:   - 20 80
+# description: At the heart of the cloud framework is an API Server. \
+#              This API Server makes command and control of the      \
+#              hypervisor, storage, and networking programmatically  \
+#              available to users in realization of the definition   \
+#              of cloud computing.
+
+### BEGIN INIT INFO
+# Provides:
+# Required-Start: $remote_fs $network $syslog
+# Required-Stop: $remote_fs $syslog
+# Default-Stop: 0 1 6
+# Short-Description: OpenStack Nova API Server
+# Description: At the heart of the cloud framework is an API Server.
+#              This API Server makes command and control of the
+#              hypervisor, storage, and networking programmatically
+#              available to users in realization of the definition
+#              of cloud computing.
+### END INIT INFO
+
+. /etc/rc.d/init.d/functions
+
+suffix=api
+prog=openstack-nova-$suffix
+exec="/usr/bin/nova-$suffix"
+config="/etc/nova/nova.conf"
+pidfile="/var/run/nova/nova-$suffix.pid"
+logfile="/var/log/nova/$suffix.log"
+
+[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
+
+lockfile=/var/lock/subsys/$prog
+
+start() {
+    [ -x $exec ] || exit 5
+    [ -f $config ] || exit 6
+    echo -n $"Starting $prog: "
+    daemon --user nova --pidfile $pidfile "$exec --flagfile $config --logfile $logfile &>/dev/null & echo \$! > $pidfile"
+    retval=$?
+    echo
+    [ $retval -eq 0 ] && touch $lockfile
+    return $retval
+}
+
+stop() {
+    echo -n $"Stopping $prog: "
+    killproc -p $pidfile $prog
+    retval=$?
+    echo
+    [ $retval -eq 0 ] && rm -f $lockfile
+    return $retval
+}
+
+restart() {
+    stop
+    start
+}
+
+reload() {
+    restart
+}
+
+force_reload() {
+    restart
+}
+
+rh_status() {
+    status -p $pidfile $prog
+}
+
+rh_status_q() {
+    rh_status >/dev/null 2>&1
+}
+
+
+case "$1" in
+    start)
+        rh_status_q && exit 0
+        $1
+        ;;
+    stop)
+        rh_status_q || exit 0
+        $1
+        ;;
+    restart)
+        $1
+        ;;
+    reload)
+        rh_status_q || exit 7
+        $1
+        ;;
+    force-reload)
+        force_reload
+        ;;
+    status)
+        rh_status
+        ;;
+    condrestart|try-restart)
+        rh_status_q || exit 0
+        restart
+        ;;
+    *)
+        echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
+        exit 2
+esac
+exit $?
diff --git a/openstack-nova-compute.init b/openstack-nova-compute.init
new file mode 100644
index 0000000..ca50bdf
--- /dev/null
+++ b/openstack-nova-compute.init
@@ -0,0 +1,118 @@
+#!/bin/sh
+#
+# openstack-nova-compute  OpenStack Nova Compute Worker
+#
+# chkconfig:   - 20 80
+# description: Compute workers manage computing instances on host  \
+#               machines. Through the API, commands are dispatched \
+#               to compute workers to:                             \
+#               * Run instances                                    \
+#               * Terminate instances                              \
+#               * Reboot instances                                 \
+#               * Attach volumes                                   \
+#               * Detach volumes                                   \
+#               * Get console output
+
+### BEGIN INIT INFO
+# Provides:
+# Required-Start: $remote_fs $network $syslog
+# Required-Stop: $remote_fs $syslog
+# Default-Stop: 0 1 6
+# Short-Description: OpenStack Nova Compute Worker
+# Description: Compute workers manage computing instances on host
+#               machines. Through the API, commands are dispatched
+#               to compute workers to:
+#               * Run instances
+#               * Terminate instances
+#               * Reboot instances
+#               * Attach volumes
+#               * Detach volumes
+#               * Get console output
+### END INIT INFO
+
+. /etc/rc.d/init.d/functions
+
+suffix=compute
+prog=openstack-nova-$suffix
+exec="/usr/bin/nova-$suffix"
+config="/etc/nova/nova.conf"
+pidfile="/var/run/nova/nova-$suffix.pid"
+logfile="/var/log/nova/$suffix.log"
+
+[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
+
+lockfile=/var/lock/subsys/$prog
+
+start() {
+    [ -x $exec ] || exit 5
+    [ -f $config ] || exit 6
+    echo -n $"Starting $prog: "
+    daemon --user nova --pidfile $pidfile "$exec --flagfile $config --logfile $logfile &>/dev/null & echo \$! > $pidfile"
+    retval=$?
+    echo
+    [ $retval -eq 0 ] && touch $lockfile
+    return $retval
+}
+
+stop() {
+    echo -n $"Stopping $prog: "
+    killproc -p $pidfile $prog
+    retval=$?
+    echo
+    [ $retval -eq 0 ] && rm -f $lockfile
+    return $retval
+}
+
+restart() {
+    stop
+    start
+}
+
+reload() {
+    restart
+}
+
+force_reload() {
+    restart
+}
+
+rh_status() {
+    status -p $pidfile $prog
+}
+
+rh_status_q() {
+    rh_status >/dev/null 2>&1
+}
+
+
+case "$1" in
+    start)
+        rh_status_q && exit 0
+        $1
+        ;;
+    stop)
+        rh_status_q || exit 0
+        $1
+        ;;
+    restart)
+        $1
+        ;;
+    reload)
+        rh_status_q || exit 7
+        $1
+        ;;
+    force-reload)
+        force_reload
+        ;;
+    status)
+        rh_status
+        ;;
+    condrestart|try-restart)
+        rh_status_q || exit 0
+        restart
+        ;;
+    *)
+        echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
+        exit 2
+esac
+exit $?
diff --git a/openstack-nova-direct-api.init b/openstack-nova-direct-api.init
new file mode 100644
index 0000000..4a52506
--- /dev/null
+++ b/openstack-nova-direct-api.init
@@ -0,0 +1,110 @@
+#!/bin/sh
+#
+# openstack-nova-api  OpenStack Nova Direct API Server
+#
+# chkconfig:   - 20 80
+# description: At the heart of the cloud framework is an API Server. \
+#              This API Server makes command and control of the      \
+#              hypervisor, storage, and networking programmatically  \
+#              available to users in realization of the definition   \
+#              of cloud computing.
+
+### BEGIN INIT INFO
+# Provides:
+# Required-Start: $remote_fs $network $syslog
+# Required-Stop: $remote_fs $syslog
+# Default-Stop: 0 1 6
+# Short-Description: OpenStack Nova Direct API Server
+# Description: At the heart of the cloud framework is an API Server.
+#              This API Server makes command and control of the
+#              hypervisor, storage, and networking programmatically
+#              available to users in realization of the definition
+#              of cloud computing.
+### END INIT INFO
+
+. /etc/rc.d/init.d/functions
+
+suffix=direct-api
+prog=openstack-nova-$suffix
+exec="/usr/bin/nova-$suffix"
+config="/etc/nova/nova.conf"
+pidfile="/var/run/nova/nova-$suffix.pid"
+logfile="/var/log/nova/$suffix.log"
+
+[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
+
+lockfile=/var/lock/subsys/$prog
+
+start() {
+    [ -x $exec ] || exit 5
+    [ -f $config ] || exit 6
+    echo -n $"Starting $prog: "
+    daemon --user nova --pidfile $pidfile "$exec --flagfile $config --logfile $logfile &>/dev/null & echo \$! > $pidfile"
+    retval=$?
+    echo
+    [ $retval -eq 0 ] && touch $lockfile
+    return $retval
+}
+
+stop() {
+    echo -n $"Stopping $prog: "
+    killproc -p $pidfile $prog
+    retval=$?
+    echo
+    [ $retval -eq 0 ] && rm -f $lockfile
+    return $retval
+}
+
+restart() {
+    stop
+    start
+}
+
+reload() {
+    restart
+}
+
+force_reload() {
+    restart
+}
+
+rh_status() {
+    status -p $pidfile $prog
+}
+
+rh_status_q() {
+    rh_status >/dev/null 2>&1
+}
+
+
+case "$1" in
+    start)
+        rh_status_q && exit 0
+        $1
+        ;;
+    stop)
+        rh_status_q || exit 0
+        $1
+        ;;
+    restart)
+        $1
+        ;;
+    reload)
+        rh_status_q || exit 7
+        $1
+        ;;
+    force-reload)
+        force_reload
+        ;;
+    status)
+        rh_status
+        ;;
+    condrestart|try-restart)
+        rh_status_q || exit 0
+        restart
+        ;;
+    *)
+        echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
+        exit 2
+esac
+exit $?
diff --git a/openstack-nova-network.init b/openstack-nova-network.init
new file mode 100644
index 0000000..e7c6ca5
--- /dev/null
+++ b/openstack-nova-network.init
@@ -0,0 +1,116 @@
+#!/bin/sh
+#
+# openstack-nova-network  OpenStack Nova Network Controller
+#
+# chkconfig:   - 20 80
+# description: The Network Controller manages the networking resources \
+#              on host machines. The API server dispatches commands    \
+#              through the message queue, which are subsequently       \
+#              processed by Network Controllers.                       \
+#              Specific operations include:                            \
+#              * Allocate Fixed IP Addresses                           \
+#              * Configuring VLANs for projects                        \
+#              * Configuring networks for compute nodes                \
+
+### BEGIN INIT INFO
+# Provides:
+# Required-Start: $remote_fs $network $syslog
+# Required-Stop: $remote_fs $syslog
+# Default-Stop: 0 1 6
+# Short-Description: OpenStack Nova Network Controller
+# Description: The Network Controller manages the networking resources
+#              on host machines. The API server dispatches commands
+#              through the message queue, which are subsequently
+#              processed by Network Controllers.
+#              Specific operations include:
+#              * Allocate Fixed IP Addresses
+#              * Configuring VLANs for projects
+#              * Configuring networks for compute nodes
+### END INIT INFO
+
+. /etc/rc.d/init.d/functions
+
+suffix=network
+prog=openstack-nova-$suffix
+exec="/usr/bin/nova-$suffix"
+config="/etc/nova/nova.conf"
+pidfile="/var/run/nova/nova-$suffix.pid"
+logfile="/var/log/nova/$suffix.log"
+
+[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
+
+lockfile=/var/lock/subsys/$prog
+
+start() {
+    [ -x $exec ] || exit 5
+    [ -f $config ] || exit 6
+    echo -n $"Starting $prog: "
+    daemon --user nova --pidfile $pidfile "$exec --flagfile $config --logfile $logfile &>/dev/null & echo \$! > $pidfile"
+    retval=$?
+    echo
+    [ $retval -eq 0 ] && touch $lockfile
+    return $retval
+}
+
+stop() {
+    echo -n $"Stopping $prog: "
+    killproc -p $pidfile $prog
+    retval=$?
+    echo
+    [ $retval -eq 0 ] && rm -f $lockfile
+    return $retval
+}
+
+restart() {
+    stop
+    start
+}
+
+reload() {
+    restart
+}
+
+force_reload() {
+    restart
+}
+
+rh_status() {
+    status -p $pidfile $prog
+}
+
+rh_status_q() {
+    rh_status >/dev/null 2>&1
+}
+
+
+case "$1" in
+    start)
+        rh_status_q && exit 0
+        $1
+        ;;
+    stop)
+        rh_status_q || exit 0
+        $1
+        ;;
+    restart)
+        $1
+        ;;
+    reload)
+        rh_status_q || exit 7
+        $1
+        ;;
+    force-reload)
+        force_reload
+        ;;
+    status)
+        rh_status
+        ;;
+    condrestart|try-restart)
+        rh_status_q || exit 0
+        restart
+        ;;
+    *)
+        echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
+        exit 2
+esac
+exit $?
diff --git a/openstack-nova-objectstore.init b/openstack-nova-objectstore.init
new file mode 100644
index 0000000..57c30d9
--- /dev/null
+++ b/openstack-nova-objectstore.init
@@ -0,0 +1,102 @@
+#!/bin/sh
+#
+# openstack-nova-objectstore  OpenStack Nova Object Storage
+#
+# chkconfig:   - 20 80
+# description: Implementation of an S3-like storage server based on local files.
+
+### BEGIN INIT INFO
+# Provides:
+# Required-Start: $remote_fs $network $syslog
+# Required-Stop: $remote_fs $syslog
+# Default-Stop: 0 1 6
+# Short-Description: OpenStack Nova Object Storage
+# Description: Implementation of an S3-like storage server based on local files.
+### END INIT INFO
+
+. /etc/rc.d/init.d/functions
+
+suffix=objectstore
+prog=openstack-nova-$suffix
+exec="/usr/bin/nova-$suffix"
+config="/etc/nova/nova.conf"
+pidfile="/var/run/nova/nova-$suffix.pid"
+logfile="/var/log/nova/$suffix.log"
+
+[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
+
+lockfile=/var/lock/subsys/$prog
+
+start() {
+    [ -x $exec ] || exit 5
+    [ -f $config ] || exit 6
+    echo -n $"Starting $prog: "
+    daemon --user nova --pidfile $pidfile "$exec --flagfile $config --logfile $logfile &>/dev/null & echo \$! > $pidfile"
+    retval=$?
+    echo
+    [ $retval -eq 0 ] && touch $lockfile
+    return $retval
+}
+
+stop() {
+    echo -n $"Stopping $prog: "
+    killproc -p $pidfile $prog
+    retval=$?
+    echo
+    [ $retval -eq 0 ] && rm -f $lockfile
+    return $retval
+}
+
+restart() {
+    stop
+    start
+}
+
+reload() {
+    restart
+}
+
+force_reload() {
+    restart
+}
+
+rh_status() {
+    status -p $pidfile $prog
+}
+
+rh_status_q() {
+    rh_status >/dev/null 2>&1
+}
+
+
+case "$1" in
+    start)
+        rh_status_q && exit 0
+        $1
+        ;;
+    stop)
+        rh_status_q || exit 0
+        $1
+        ;;
+    restart)
+        $1
+        ;;
+    reload)
+        rh_status_q || exit 7
+        $1
+        ;;
+    force-reload)
+        force_reload
+        ;;
+    status)
+        rh_status
+        ;;
+    condrestart|try-restart)
+        rh_status_q || exit 0
+        restart
+        ;;
+    *)
+        echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
+        exit 2
+esac
+exit $?
diff --git a/openstack-nova-scheduler.init b/openstack-nova-scheduler.init
new file mode 100644
index 0000000..95a943d
--- /dev/null
+++ b/openstack-nova-scheduler.init
@@ -0,0 +1,102 @@
+#!/bin/sh
+#
+# openstack-nova-scheduler  OpenStack Nova Scheduler
+#
+# chkconfig:   - 20 80
+# description: Determines which physical hardware to allocate to a virtual resource
+
+### BEGIN INIT INFO
+# Provides:
+# Required-Start: $remote_fs $network $syslog
+# Required-Stop: $remote_fs $syslog
+# Default-Stop: 0 1 6
+# Short-Description: OpenStack Nova Scheduler
+# Description: Determines which physical hardware to allocate to a virtual resource
+### END INIT INFO
+
+. /etc/rc.d/init.d/functions
+
+suffix=scheduler
+prog=openstack-nova-$suffix
+exec="/usr/bin/nova-$suffix"
+config="/etc/nova/nova.conf"
+pidfile="/var/run/nova/nova-$suffix.pid"
+logfile="/var/log/nova/$suffix.log"
+
+[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
+
+lockfile=/var/lock/subsys/$prog
+
+start() {
+    [ -x $exec ] || exit 5
+    [ -f $config ] || exit 6
+    echo -n $"Starting $prog: "
+    daemon --user nova --pidfile $pidfile "$exec --flagfile $config --logfile $logfile &>/dev/null & echo \$! > $pidfile"
+    retval=$?
+    echo
+    [ $retval -eq 0 ] && touch $lockfile
+    return $retval
+}
+
+stop() {
+    echo -n $"Stopping $prog: "
+    killproc -p $pidfile $prog
+    retval=$?
+    echo
+    [ $retval -eq 0 ] && rm -f $lockfile
+    return $retval
+}
+
+restart() {
+    stop
+    start
+}
+
+reload() {
+    restart
+}
+
+force_reload() {
+    restart
+}
+
+rh_status() {
+    status -p $pidfile $prog
+}
+
+rh_status_q() {
+    rh_status >/dev/null 2>&1
+}
+
+
+case "$1" in
+    start)
+        rh_status_q && exit 0
+        $1
+        ;;
+    stop)
+        rh_status_q || exit 0
+        $1
+        ;;
+    restart)
+        $1
+        ;;
+    reload)
+        rh_status_q || exit 7
+        $1
+        ;;
+    force-reload)
+        force_reload
+        ;;
+    status)
+        rh_status
+        ;;
+    condrestart|try-restart)
+        rh_status_q || exit 0
+        restart
+        ;;
+    *)
+        echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
+        exit 2
+esac
+exit $?
diff --git a/openstack-nova-vncproxy.init b/openstack-nova-vncproxy.init
new file mode 100644
index 0000000..8421a81
--- /dev/null
+++ b/openstack-nova-vncproxy.init
@@ -0,0 +1,102 @@
+#!/bin/sh
+#
+# openstack-nova-vncproxy  OpenStack Nova Console VNC Proxy
+#
+# chkconfig:   - 20 80
+# description: OpenStack Nova Console VNC Proxy Server
+
+### BEGIN INIT INFO
+# Provides:
+# Required-Start: $remote_fs $network $syslog
+# Required-Stop: $remote_fs $syslog
+# Default-Stop: 0 1 6
+# Short-Description: OpenStack Nova Console VNC Proxy
+# Description: OpenStack Nova Console VNC Proxy Server
+### END INIT INFO
+
+. /etc/rc.d/init.d/functions
+
+suffix=vncproxy
+prog=openstack-nova-$suffix
+exec="/usr/bin/nova-$suffix"
+config="/etc/nova/nova.conf"
+pidfile="/var/run/nova/nova-$suffix.pid"
+logfile="/var/log/nova/$suffix.log"
+
+[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
+
+lockfile=/var/lock/subsys/$prog
+
+start() {
+    [ -x $exec ] || exit 5
+    [ -f $config ] || exit 6
+    echo -n $"Starting $prog: "
+    daemon --user nova --pidfile $pidfile "$exec --flagfile $config --logfile $logfile &>/dev/null & echo \$! > $pidfile"
+    retval=$?
+    echo
+    [ $retval -eq 0 ] && touch $lockfile
+    return $retval
+}
+
+stop() {
+    echo -n $"Stopping $prog: "
+    killproc -p $pidfile $prog
+    retval=$?
+    echo
+    [ $retval -eq 0 ] && rm -f $lockfile
+    return $retval
+}
+
+restart() {
+    stop
+    start
+}
+
+reload() {
+    restart
+}
+
+force_reload() {
+    restart
+}
+
+rh_status() {
+    status -p $pidfile $prog
+}
+
+rh_status_q() {
+    rh_status >/dev/null 2>&1
+}
+
+
+case "$1" in
+    start)
+        rh_status_q && exit 0
+        $1
+        ;;
+    stop)
+        rh_status_q || exit 0
+        $1
+        ;;
+    restart)
+        $1
+        ;;
+    reload)
+        rh_status_q || exit 7
+        $1
+        ;;
+    force-reload)
+        force_reload
+        ;;
+    status)
+        rh_status
+        ;;
+    condrestart|try-restart)
+        rh_status_q || exit 0
+        restart
+        ;;
+    *)
+        echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
+        exit 2
+esac
+exit $?
diff --git a/openstack-nova-volume.init b/openstack-nova-volume.init
new file mode 100644
index 0000000..9b397e2
--- /dev/null
+++ b/openstack-nova-volume.init
@@ -0,0 +1,110 @@
+#!/bin/sh
+#
+# openstack-nova-volume  OpenStack Nova Volume Worker
+#
+# chkconfig:   - 20 80
+# description:	Volume Workers interact with iSCSI storage to manage    \
+#		LVM-based instance volumes. Specific functions include: \
+#		* Create Volumes                                        \
+#		* Delete Volumes                                        \
+#		* Establish Compute volumes
+
+### BEGIN INIT INFO
+# Provides:
+# Required-Start: $remote_fs $network $syslog
+# Required-Stop: $remote_fs $syslog
+# Default-Stop: 0 1 6
+# Short-Description: OpenStack Nova Volume Worker
+# Description:	Volume Workers interact with iSCSI storage to manage
+#		LVM-based instance volumes. Specific functions include:
+#		* Create Volumes
+#		* Delete Volumes
+#		* Establish Compute volumes
+### END INIT INFO
+
+. /etc/rc.d/init.d/functions
+
+suffix=volume
+prog=openstack-nova-$suffix
+exec="/usr/bin/nova-$suffix"
+config="/etc/nova/nova.conf"
+pidfile="/var/run/nova/nova-$suffix.pid"
+logfile="/var/log/nova/$suffix.log"
+
+[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
+
+lockfile=/var/lock/subsys/$prog
+
+start() {
+    [ -x $exec ] || exit 5
+    [ -f $config ] || exit 6
+    echo -n $"Starting $prog: "
+    daemon --user nova --pidfile $pidfile "$exec --flagfile $config --logfile $logfile &>/dev/null & echo \$! > $pidfile"
+    retval=$?
+    echo
+    [ $retval -eq 0 ] && touch $lockfile
+    return $retval
+}
+
+stop() {
+    echo -n $"Stopping $prog: "
+    killproc -p $pidfile $prog
+    retval=$?
+    echo
+    [ $retval -eq 0 ] && rm -f $lockfile
+    return $retval
+}
+
+restart() {
+    stop
+    start
+}
+
+reload() {
+    restart
+}
+
+force_reload() {
+    restart
+}
+
+rh_status() {
+    status -p $pidfile $prog
+}
+
+rh_status_q() {
+    rh_status >/dev/null 2>&1
+}
+
+
+case "$1" in
+    start)
+        rh_status_q && exit 0
+        $1
+        ;;
+    stop)
+        rh_status_q || exit 0
+        $1
+        ;;
+    restart)
+        $1
+        ;;
+    reload)
+        rh_status_q || exit 7
+        $1
+        ;;
+    force-reload)
+        force_reload
+        ;;
+    status)
+        rh_status
+        ;;
+    condrestart|try-restart)
+        rh_status_q || exit 0
+        restart
+        ;;
+    *)
+        echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
+        exit 2
+esac
+exit $?
diff --git a/openstack-nova.spec b/openstack-nova.spec
index 9be6360..d38de42 100644
--- a/openstack-nova.spec
+++ b/openstack-nova.spec
@@ -14,15 +14,15 @@ Source0:          http://launchpad.net/nova/diablo/2011.3/+download/nova-%{versi
 Source1:          nova.conf
 Source6:          nova.logrotate
 
-Source11:         openstack-nova-api.service
-Source12:         openstack-nova-compute.service
-Source13:         openstack-nova-network.service
-Source14:         openstack-nova-objectstore.service
-Source15:         openstack-nova-scheduler.service
-Source16:         openstack-nova-volume.service
-Source17:         openstack-nova-direct-api.service
-Source18:         openstack-nova-ajax-console-proxy.service
-Source19:         openstack-nova-vncproxy.service
+Source11:         openstack-nova-api.init
+Source12:         openstack-nova-compute.init
+Source13:         openstack-nova-network.init
+Source14:         openstack-nova-objectstore.init
+Source15:         openstack-nova-scheduler.init
+Source16:         openstack-nova-volume.init
+Source17:         openstack-nova-direct-api.init
+Source18:         openstack-nova-ajax-console-proxy.init
+Source19:         openstack-nova-vncproxy.init
 
 Source20:         nova-sudoers
 Source21:         nova-polkit.pkla
@@ -64,9 +64,9 @@ Requires:         openssl
 Requires:         rabbitmq-server
 Requires:         sudo
 
-Requires(post):   systemd-units
-Requires(preun):  systemd-units
-Requires(postun): systemd-units
+Requires(post):   chkconfig
+Requires(postun): initscripts
+Requires(preun):  chkconfig
 Requires(pre):    shadow-utils qemu-kvm
 
 %description
@@ -135,7 +135,6 @@ Group:            Documentation
 
 Requires:         %{name} = %{version}-%{release}
 
-BuildRequires:    systemd-units
 BuildRequires:    python-sphinx
 BuildRequires:    graphviz
 BuildRequires:    python-distutils-extra
@@ -233,15 +232,15 @@ install -d -m 755 %{buildroot}%{_sysconfdir}/nova
 install -p -D -m 640 %{SOURCE1} %{buildroot}%{_sysconfdir}/nova/nova.conf
 
 # Install initscripts for Nova services
-install -p -D -m 755 %{SOURCE11} %{buildroot}%{_unitdir}/openstack-nova-api.service
-install -p -D -m 755 %{SOURCE12} %{buildroot}%{_unitdir}/openstack-nova-compute.service
-install -p -D -m 755 %{SOURCE13} %{buildroot}%{_unitdir}/openstack-nova-network.service
-install -p -D -m 755 %{SOURCE14} %{buildroot}%{_unitdir}/openstack-nova-objectstore.service
-install -p -D -m 755 %{SOURCE15} %{buildroot}%{_unitdir}/openstack-nova-scheduler.service
-install -p -D -m 755 %{SOURCE16} %{buildroot}%{_unitdir}/openstack-nova-volume.service
-install -p -D -m 755 %{SOURCE17} %{buildroot}%{_unitdir}/openstack-nova-direct-api.service
-install -p -D -m 755 %{SOURCE18} %{buildroot}%{_unitdir}/openstack-nova-ajax-console-proxy.service
-install -p -D -m 755 %{SOURCE19} %{buildroot}%{_unitdir}/openstack-nova-vncproxy.service
+install -p -D -m 755 %{SOURCE11} %{buildroot}%{_initrddir}/openstack-nova-api
+install -p -D -m 755 %{SOURCE12} %{buildroot}%{_initrddir}/openstack-nova-compute
+install -p -D -m 755 %{SOURCE13} %{buildroot}%{_initrddir}/openstack-nova-network
+install -p -D -m 755 %{SOURCE14} %{buildroot}%{_initrddir}/openstack-nova-objectstore
+install -p -D -m 755 %{SOURCE15} %{buildroot}%{_initrddir}/openstack-nova-scheduler
+install -p -D -m 755 %{SOURCE16} %{buildroot}%{_initrddir}/openstack-nova-volume
+install -p -D -m 755 %{SOURCE17} %{buildroot}%{_initrddir}/openstack-nova-direct-api
+install -p -D -m 755 %{SOURCE18} %{buildroot}%{_initrddir}/openstack-nova-ajax-console-proxy
+install -p -D -m 755 %{SOURCE19} %{buildroot}%{_initrddir}/openstack-nova-vncproxy
 
 # Install sudoers
 install -p -D -m 440 %{SOURCE20} %{buildroot}%{_sysconfdir}/sudoers.d/nova
@@ -283,26 +282,24 @@ if [ ! -f %{_sharedstatedir}/nova/nova.sqlite ]; then
     runuser -l -s /bin/bash -c 'nova-manage --flagfile=/dev/null --logdir=%{_localstatedir}/log/nova --state_path=%{_sharedstatedir}/nova db sync' nova
     chmod 600 %{_sharedstatedir}/nova/nova.sqlite
 fi
-if [ $1 -eq 1 ] ; then
-    # Initial installation
-    /bin/systemctl daemon-reload >/dev/null 2>&1 || :
-fi
 
+# Register the services
+for svc in api compute network objectstore scheduler volume direct-api ajax-console-proxy vncproxy; do
+    /sbin/chkconfig --add openstack-nova-${svc}
+done
 
 %preun
 if [ $1 -eq 0 ] ; then
     for svc in api compute network objectstore scheduler volume direct-api ajax-console-proxy vncproxy; do
-        /bin/systemctl --no-reload disable openstack-nova-${svc}.service > /dev/null 2>&1 || :
-        /bin/systemctl stop openstack-nova-${svc}.service > /dev/null 2>&1 || :
+        /sbin/service openstack-nova-${svc} stop >/dev/null 2>&1
+        /sbin/chkconfig --del openstack-nova-${svc}
     done
 fi
 
 %postun
-/bin/systemctl daemon-reload >/dev/null 2>&1 || :
-if [ $1 -ge 1 ] ; then
-    # Package upgrade, not uninstall
+if [ "$1" -ge 1 ] ; then
     for svc in api compute network objectstore scheduler volume direct-api ajax-console-proxy vncproxy; do
-        /bin/systemctl try-restart openstack-nova-${svc}.service >/dev/null 2>&1 || :
+        /sbin/service openstack-nova-${svc} condrestart > /dev/null 2>&1 || :
     done
 fi
 
@@ -319,7 +316,7 @@ fi
 %dir %attr(0755, nova, root) %{_localstatedir}/run/nova
 
 %{_bindir}/nova-*
-%{_unitdir}/openstack-nova-*.service
+%{_initrddir}/openstack-nova-*
 %{_datarootdir}/nova
 %{_mandir}/man1/nova*.1.gz
 


More information about the scm-commits mailing list