From 373518f1cc8a71d86dbc86c1c63c2eeae8a69dbf Mon Sep 17 00:00:00 2001 From: Dan Bode Date: Mon, 23 Apr 2012 23:02:33 -0700 Subject: [PATCH] Add missing file for novncproxy --- .../puppet/nova/files/nova-novncproxy.init | 85 +++++++++++++++++++ deployment/puppet/nova/manifests/vncproxy.pp | 2 +- 2 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 deployment/puppet/nova/files/nova-novncproxy.init diff --git a/deployment/puppet/nova/files/nova-novncproxy.init b/deployment/puppet/nova/files/nova-novncproxy.init new file mode 100644 index 0000000000..474fba4bd2 --- /dev/null +++ b/deployment/puppet/nova/files/nova-novncproxy.init @@ -0,0 +1,85 @@ +#!/bin/bash -e +# upstart-job +# +# Symlink target for initscripts that have been converted to Upstart. + +set -e + +INITSCRIPT="$(basename "$0")" +JOB="${INITSCRIPT%.sh}" + +if [ "$JOB" = "upstart-job" ]; then + if [ -z "$1" ]; then + echo "Usage: upstart-job JOB COMMAND" 1>&2 + exit 1 + fi + + JOB="$1" + INITSCRIPT="$1" + shift +else + if [ -z "$1" ]; then + echo "Usage: $0 COMMAND" 1>&2 + exit 1 + fi +fi + +COMMAND="$1" +shift + + +if [ -z "$DPKG_MAINTSCRIPT_PACKAGE" ]; then + ECHO=echo +else + ECHO=: +fi + +$ECHO "Rather than invoking init scripts through /etc/init.d, use the service(8)" +$ECHO "utility, e.g. service $INITSCRIPT $COMMAND" + +case $COMMAND in +status) + $ECHO + $ECHO "Since the script you are attempting to invoke has been converted to an" + $ECHO "Upstart job, you may also use the $COMMAND(8) utility, e.g. $COMMAND $JOB" + $COMMAND "$JOB" + ;; +start|stop) + $ECHO + $ECHO "Since the script you are attempting to invoke has been converted to an" + $ECHO "Upstart job, you may also use the $COMMAND(8) utility, e.g. $COMMAND $JOB" + if status "$JOB" 2>/dev/null | grep -q ' start/'; then + RUNNING=1 + fi + if [ -z "$RUNNING" ] && [ "$COMMAND" = "stop" ]; then + exit 0 + elif [ -n "$RUNNING" ] && [ "$COMMAND" = "start" ]; then + exit 0 + fi + $COMMAND "$JOB" + ;; +restart) + $ECHO + $ECHO "Since the script you are attempting to invoke has been converted to an" + $ECHO "Upstart job, you may also use the stop(8) and then start(8) utilities," + $ECHO "e.g. stop $JOB ; start $JOB. The restart(8) utility is also available." + if status "$JOB" 2>/dev/null | grep -q ' start/'; then + RUNNING=1 + fi + if [ -n "$RUNNING" ] ; then + stop "$JOB" + fi + start "$JOB" + ;; +reload|force-reload) + $ECHO + $ECHO "Since the script you are attempting to invoke has been converted to an" + $ECHO "Upstart job, you may also use the reload(8) utility, e.g. reload $JOB" + reload "$JOB" + ;; +*) + $ECHO + $ECHO "The script you are attempting to invoke has been converted to an Upstart" 1>&2 + $ECHO "job, but $COMMAND is not supported for Upstart jobs." 1>&2 + exit 1 +esac diff --git a/deployment/puppet/nova/manifests/vncproxy.pp b/deployment/puppet/nova/manifests/vncproxy.pp index 6e12bef1c0..6b2baf1029 100644 --- a/deployment/puppet/nova/manifests/vncproxy.pp +++ b/deployment/puppet/nova/manifests/vncproxy.pp @@ -9,7 +9,7 @@ class nova::vncproxy() { } file { '/etc/init.d/nova-novncproxy': ensure => present, - source => 'puppet:///modules/openstack/nova/nova-novncproxy.init', + source => 'puppet:///modules/nova/nova-novncproxy.init', mode => 0750, } # this temporary upstart script needs to be removed