diff options
| author | Mark Asselstine <mark.asselstine@windriver.com> | 2018-04-04 16:02:56 -0400 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@windriver.com> | 2018-04-09 10:48:37 -0400 |
| commit | e7b4a0b965bb40861a487c13199755044919472a (patch) | |
| tree | 740373e9594abbadd846279582c596cc9e2607dd /meta-openstack/recipes-devtools/python/python-nova/nova.init | |
| parent | c87a3d517bd49b1e915ba9bb3f20bfc86d239dbc (diff) | |
| download | meta-cloud-services-e7b4a0b965bb40861a487c13199755044919472a.tar.gz | |
python-nova: uprev to latest openstack sable/pike release
This requires several new recipes and package uprevs (python-tooz,
python-os-brick, python-pypowervm, python-networkx,
python-microversion-parse, python-os-win, python-os-vif, and
python-os-traits). Along with updates to make things work with
systemd.
We also take steps to make setup/init use the directions from
https://docs.openstack.org/nova/pike/install/controller-install-ubuntu.html
After these changes we can validate that nova is operating nominally
using the command:
+-------+--------------------------------------+
| Name | UUID |
+-------+--------------------------------------+
| cell0 | 00000000-0000-0000-0000-000000000000 |
| cell1 | f547fa04-7c82-4498-95ee-210fc40abdb6 |
+-------+--------------------------------------+
Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Diffstat (limited to 'meta-openstack/recipes-devtools/python/python-nova/nova.init')
| -rw-r--r-- | meta-openstack/recipes-devtools/python/python-nova/nova.init | 136 |
1 files changed, 0 insertions, 136 deletions
diff --git a/meta-openstack/recipes-devtools/python/python-nova/nova.init b/meta-openstack/recipes-devtools/python/python-nova/nova.init deleted file mode 100644 index 607b6de..0000000 --- a/meta-openstack/recipes-devtools/python/python-nova/nova.init +++ /dev/null | |||
| @@ -1,136 +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 [ ! -d /var/run/nova ]; then | ||
| 19 | mkdir -p /var/run/nova | ||
| 20 | chown nova:root /var/run/nova/ | ||
| 21 | fi | ||
| 22 | |||
| 23 | if [ ! -d /var/lock/nova ]; then | ||
| 24 | mkdir -p /var/lock/nova | ||
| 25 | chown nova:root /var/lock/nova/ | ||
| 26 | fi | ||
| 27 | |||
| 28 | if ! [ -x ${DAEMON} ] ; then | ||
| 29 | exit 0 | ||
| 30 | fi | ||
| 31 | |||
| 32 | start () | ||
| 33 | { | ||
| 34 | if [ -e $PIDFILE ]; then | ||
| 35 | PIDDIR=/proc/$(cat $PIDFILE) | ||
| 36 | if [ -d ${PIDDIR} ]; then | ||
| 37 | echo "$DESC already running." | ||
| 38 | exit 1 | ||
| 39 | else | ||
| 40 | echo "Removing stale PID file $PIDFILE" | ||
| 41 | rm -f $PIDFILE | ||
| 42 | fi | ||
| 43 | fi | ||
| 44 | PIDDIR=`dirname $PIDFILE` | ||
| 45 | if [ ! -d $PIDDIR ]; then | ||
| 46 | mkdir -p $PIDDIR | ||
| 47 | chown nova $PIDDIR | ||
| 48 | fi | ||
| 49 | if [ ! -d /var/log/nova ]; then | ||
| 50 | mkdir /var/log/nova | ||
| 51 | fi | ||
| 52 | echo -n "Starting $DESC..." | ||
| 53 | |||
| 54 | start-stop-daemon --start --quiet --background \ | ||
| 55 | --pidfile ${PIDFILE} --make-pidfile --exec ${DAEMON} \ | ||
| 56 | -- --log-dir=/var/log/nova | ||
| 57 | |||
| 58 | if [ $? -eq 0 ]; then | ||
| 59 | echo "done." | ||
| 60 | else | ||
| 61 | echo "failed." | ||
| 62 | fi | ||
| 63 | } | ||
| 64 | |||
| 65 | stop () | ||
| 66 | { | ||
| 67 | echo -n "Stopping $DESC..." | ||
| 68 | start-stop-daemon --stop --quiet --pidfile $PIDFILE | ||
| 69 | if [ $? -eq 0 ]; then | ||
| 70 | echo "done." | ||
| 71 | else | ||
| 72 | echo "failed." | ||
| 73 | fi | ||
| 74 | rm -f $PIDFILE | ||
| 75 | } | ||
| 76 | |||
| 77 | status() | ||
| 78 | { | ||
| 79 | pid=`cat $PIDFILE 2>/dev/null` | ||
| 80 | if [ -n "$pid" ]; then | ||
| 81 | if ps -p $pid > /dev/null 2>&1 ; then | ||
| 82 | echo "$DESC is running" | ||
| 83 | return | ||
| 84 | fi | ||
| 85 | fi | ||
| 86 | echo "$DESC is not running" | ||
| 87 | } | ||
| 88 | |||
| 89 | reset() | ||
| 90 | { | ||
| 91 | . /etc/nova/openrc | ||
| 92 | |||
| 93 | # Nova comute | ||
| 94 | simple_delete "nova list --all-tenant" "nova delete" 1 "vm" | ||
| 95 | |||
| 96 | stop | ||
| 97 | |||
| 98 | # This is to make sure postgres is configured and running | ||
| 99 | if ! pidof postmaster > /dev/null; then | ||
| 100 | /etc/init.d/postgresql-init | ||
| 101 | /etc/init.d/postgresql start | ||
| 102 | sleep 5 | ||
| 103 | fi | ||
| 104 | |||
| 105 | sudo -u postgres dropdb nova | ||
| 106 | sudo -u postgres createdb nova | ||
| 107 | sleep 2 | ||
| 108 | nova-manage db sync | ||
| 109 | |||
| 110 | start | ||
| 111 | } | ||
| 112 | |||
| 113 | case "$1" in | ||
| 114 | start) | ||
| 115 | start | ||
| 116 | ;; | ||
| 117 | stop) | ||
| 118 | stop | ||
| 119 | ;; | ||
| 120 | restart|force-reload|reload) | ||
| 121 | stop | ||
| 122 | start | ||
| 123 | ;; | ||
| 124 | status) | ||
| 125 | status | ||
| 126 | ;; | ||
| 127 | reset) | ||
| 128 | reset | ||
| 129 | ;; | ||
| 130 | *) | ||
| 131 | echo "Usage: $0 {start|stop|force-reload|restart|reload|status|reset}" | ||
| 132 | exit 1 | ||
| 133 | ;; | ||
| 134 | esac | ||
| 135 | |||
| 136 | exit 0 | ||
