From 6423ced4885488dbe8cc05249d7d16cbcfe750c2 Mon Sep 17 00:00:00 2001 From: Amy Fong Date: Thu, 20 Mar 2014 15:46:59 -0400 Subject: OpenStack: add SPICE console support Package spice-html5 Modify python-nova to add infrastructure for nova-spicehtml5proxy support. Note: spice is the default Signed-off-by: Amy Fong Signed-off-by: Bruce Ashfield --- .../python/python-nova/nova-spicehtml5proxy | 91 ++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 meta-openstack/recipes-devtools/python/python-nova/nova-spicehtml5proxy (limited to 'meta-openstack/recipes-devtools/python/python-nova/nova-spicehtml5proxy') diff --git a/meta-openstack/recipes-devtools/python/python-nova/nova-spicehtml5proxy b/meta-openstack/recipes-devtools/python/python-nova/nova-spicehtml5proxy new file mode 100644 index 0000000..d58f71e --- /dev/null +++ b/meta-openstack/recipes-devtools/python/python-nova/nova-spicehtml5proxy @@ -0,0 +1,91 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: nova-spicehtml5proxy +# Required-Start: $remote_fs $syslog +# Required-Stop: $remote_fs $syslog +# Should-Start: libvirt-bin +# Should-Stop: libvirt-bin +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: nova-spicehtml5proxy service +# Description: Provides spice html5 proxy services for the openstack +# cloud computing system +### END INIT INFO + + +set -e + +NAME=nova-spicehtml5proxy +DESC="OpenStack Compute Spice HTML5 Proxy" +SCRIPTNAME=/etc/init.d/$NAME +DAEMON=/usr/bin/nova-spicehtml5proxy +DAEMON_ARGS="" +PIDFILE=/var/run/nova/$NAME.pid + +ENABLED=true + +if test -f /etc/default/nova-consoleproxy; then + . /etc/default/nova-consoleproxy +fi + +if ! [ "${NOVA_CONSOLE_PROXY_TYPE}" = "spicehtml5" ] ; then + exit 0 +fi + +mkdir -p /var/run/nova +chown nova:root /var/run/nova/ + +mkdir -p /var/lock/nova +chown nova:root /var/lock/nova/ + +. /lib/lsb/init-functions + +export PATH="${PATH:+$PATH:}/usr/sbin:/sbin" +export TMPDIR=/var/lib/nova/tmp + +if ! [ -x ${DAEMON} ] ; then + exit 0 +fi + +status() +{ + pid=`cat $PIDFILE 2>/dev/null` + if [ -n "$pid" ]; then + if ps -p $pid >&- ; then + echo "$DESC is running" + return + fi + fi + echo "$DESC is not running" +} + +case "$1" in + start) + test "$ENABLED" = "true" || exit 0 + echo "Starting $DESC" "$NAME" + start-stop-daemon --start -b -m --pidfile $PIDFILE --exec ${DAEMON} -- ${DAEMON_ARGS} + log_end_msg $? + ;; + stop) + test "$ENABLED" = "true" || exit 0 + echo "Stopping $DESC" "$NAME" + start-stop-daemon --stop --oknodo --pidfile ${PIDFILE} + log_end_msg $? + ;; + restart|force-reload|reload) + test "$ENABLED" = "true" || exit 1 + $0 stop + sleep 1 + $0 start + ;; + status) + test "$ENABLED" = "true" || exit 0 + status + ;; + *) + echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload|status|reload|status}" + exit 1 + ;; +esac + +exit 0 -- cgit v1.2.3-54-g00ecf