diff options
| author | Amy Fong <amy.fong@windriver.com> | 2014-03-24 13:18:45 -0400 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@windriver.com> | 2014-03-25 09:56:15 -0400 |
| commit | dfc85232382af8fee180a83bd33f9d436557b774 (patch) | |
| tree | b6c2fc333b7ce925cab83111b206009ca0fb5a2d /meta-openstack/recipes-devtools/python/python-nova/nova-console.init | |
| parent | 809be55f0d276c59a8f71bb62f65fcdecede71b0 (diff) | |
| download | meta-cloud-services-dfc85232382af8fee180a83bd33f9d436557b774.tar.gz | |
OpenStack: modify controller to be able to talk to both console
We modify the controller so that both vnc and spice html5 proxies are running.
Since in the current recipe, both controller and compute share the same nova.conf
file, in the compute, both vnc and spice html5 are set to enabled and in this
configuration, vnc is chosen (in source: vnc is chosen because it's better
tested).
To change to spice, only change required is on the compute side.
The controller (since the default console_type is auto) will try to talk
to both and run whichever is available.
Signed-off-by: Amy Fong <amy.fong@windriver.com>
Diffstat (limited to 'meta-openstack/recipes-devtools/python/python-nova/nova-console.init')
| -rw-r--r-- | meta-openstack/recipes-devtools/python/python-nova/nova-console.init | 119 |
1 files changed, 0 insertions, 119 deletions
diff --git a/meta-openstack/recipes-devtools/python/python-nova/nova-console.init b/meta-openstack/recipes-devtools/python/python-nova/nova-console.init deleted file mode 100644 index bb5e94c..0000000 --- a/meta-openstack/recipes-devtools/python/python-nova/nova-console.init +++ /dev/null | |||
| @@ -1,119 +0,0 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | |||
| 3 | ### BEGIN INIT INFO | ||
| 4 | # Provides: nova-compute | ||
| 5 | # Required-Start: $remote_fs $syslog | ||
| 6 | # Required-Stop: $remote_fs $syslog | ||
| 7 | # Default-Start: 3 5 | ||
| 8 | # Default-Stop: 0 1 2 6 | ||
| 9 | # Short-Description: OpenStack Compute (Nova) - @suffix@ | ||
| 10 | # Description: OpenStack Compute (Nova) - @suffix@ | ||
| 11 | ### END INIT INFO | ||
| 12 | |||
| 13 | SUFFIX="@suffix@" | ||
| 14 | DESC="nova-@suffix@" | ||
| 15 | DAEMON="/usr/bin/nova-$SUFFIX" | ||
| 16 | PIDFILE="/var/run/nova/nova-$SUFFIX.pid" | ||
| 17 | |||
| 18 | if test -f /etc/default/nova-consoleproxy; then | ||
| 19 | . /etc/default/nova-consoleproxy | ||
| 20 | fi | ||
| 21 | |||
| 22 | |||
| 23 | # default to spicehtml5 | ||
| 24 | if [ -z "${NOVA_CONSOLE_PROXY_TYPE}" ] ; then | ||
| 25 | NOVA_CONSOLE_PROXY_TYPE="spicehtml5" | ||
| 26 | fi | ||
| 27 | |||
| 28 | if ! [ "${NOVA_CONSOLE_PROXY_TYPE}" = "@proxy_type@" ] ; then | ||
| 29 | exit 0 | ||
| 30 | fi | ||
| 31 | |||
| 32 | mkdir -p /var/run/nova | ||
| 33 | chown nova:root /var/run/nova/ | ||
| 34 | |||
| 35 | mkdir -p /var/lock/nova | ||
| 36 | chown nova:root /var/lock/nova/ | ||
| 37 | |||
| 38 | export PATH="${PATH:+$PATH:}/usr/sbin:/sbin" | ||
| 39 | export TMPDIR=/var/lib/nova/tmp | ||
| 40 | |||
| 41 | if ! [ -x ${DAEMON} ] ; then | ||
| 42 | exit 0 | ||
| 43 | fi | ||
| 44 | |||
| 45 | start () | ||
| 46 | { | ||
| 47 | if [ -e $PIDFILE ]; then | ||
| 48 | PIDDIR=/proc/$(cat $PIDFILE) | ||
| 49 | if [ -d ${PIDDIR} ]; then | ||
| 50 | echo "$DESC already running." | ||
| 51 | exit 1 | ||
| 52 | else | ||
| 53 | echo "Removing stale PID file $PIDFILE" | ||
| 54 | rm -f $PIDFILE | ||
| 55 | fi | ||
| 56 | fi | ||
| 57 | PIDDIR=`dirname $PIDFILE` | ||
| 58 | if [ ! -d $PIDDIR ]; then | ||
| 59 | mkdir -p $PIDDIR | ||
| 60 | chown nova $PIDDIR | ||
| 61 | fi | ||
| 62 | echo -n "Starting $DESC..." | ||
| 63 | |||
| 64 | sudo -u nova \ | ||
| 65 | start-stop-daemon --start --quiet --background \ | ||
| 66 | --pidfile ${PIDFILE} --make-pidfile --exec ${DAEMON} | ||
| 67 | |||
| 68 | if [ $? -eq 0 ]; then | ||
| 69 | echo "done." | ||
| 70 | else | ||
| 71 | echo "failed." | ||
| 72 | fi | ||
| 73 | } | ||
| 74 | |||
| 75 | stop () | ||
| 76 | { | ||
| 77 | echo -n "Stopping $DESC..." | ||
| 78 | start-stop-daemon --stop --quiet --pidfile $PIDFILE | ||
| 79 | if [ $? -eq 0 ]; then | ||
| 80 | echo "done." | ||
| 81 | else | ||
| 82 | echo "failed." | ||
| 83 | fi | ||
| 84 | rm -f $PIDFILE | ||
| 85 | } | ||
| 86 | |||
| 87 | status() | ||
| 88 | { | ||
| 89 | pid=`cat $PIDFILE 2>/dev/null` | ||
| 90 | if [ -n "$pid" ]; then | ||
| 91 | if ps -p $pid >&- ; then | ||
| 92 | echo "$DESC is running" | ||
| 93 | return | ||
| 94 | fi | ||
| 95 | fi | ||
| 96 | echo "$DESC is not running" | ||
| 97 | } | ||
| 98 | |||
| 99 | case "$1" in | ||
| 100 | start) | ||
| 101 | start | ||
| 102 | ;; | ||
| 103 | stop) | ||
| 104 | stop | ||
| 105 | ;; | ||
| 106 | restart|force-reload|reload) | ||
| 107 | stop | ||
| 108 | start | ||
| 109 | ;; | ||
| 110 | status) | ||
| 111 | status | ||
| 112 | ;; | ||
| 113 | *) | ||
| 114 | echo "Usage: $0 {start|stop|force-reload|restart|reload|status}" | ||
| 115 | exit 1 | ||
| 116 | ;; | ||
| 117 | esac | ||
| 118 | |||
| 119 | exit 0 | ||
