summaryrefslogtreecommitdiffstats
path: root/meta-openstack/recipes-devtools/python/python-neutron/neutron-server.init
diff options
context:
space:
mode:
authorMark Asselstine <mark.asselstine@windriver.com>2018-01-17 10:12:28 -0500
committerBruce Ashfield <bruce.ashfield@windriver.com>2018-01-18 10:47:31 -0500
commit992463503e844fe40f3bb2a56df5db0cb715942e (patch)
tree725e632d5155ac9a79a25cae4781eb9742176b4a /meta-openstack/recipes-devtools/python/python-neutron/neutron-server.init
parenta49d21ce53618b12ae0b03806fd56f1a8949f243 (diff)
downloadmeta-cloud-services-992463503e844fe40f3bb2a56df5db0cb715942e.tar.gz
python-neutron: uprev to latest stable/pike
Following along with other recent openstack component uprevs the configuration has been changed to match the installation/setup configuration documented by the openstack community. We have also made the switch to using systemd. The initial configuration file (neutron.conf) was generated by getting things mostly updated and running, then copying/cloning the source repo on the target and running the setup scripts (see ./tools/generate_config_file_samples.sh) With these updates neutron is running and available but is yet to be fully tested, this must be done once we have a running compute node and guests. Required updates/uprevs/introduction to: python-ryu, python-neutron-lib, python-os-xenapi, python-oslo.privsep, python-ovs, python-weakrefmethod, and more 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-neutron/neutron-server.init')
-rw-r--r--meta-openstack/recipes-devtools/python/python-neutron/neutron-server.init142
1 files changed, 0 insertions, 142 deletions
diff --git a/meta-openstack/recipes-devtools/python/python-neutron/neutron-server.init b/meta-openstack/recipes-devtools/python/python-neutron/neutron-server.init
deleted file mode 100644
index 77f8f01..0000000
--- a/meta-openstack/recipes-devtools/python/python-neutron/neutron-server.init
+++ /dev/null
@@ -1,142 +0,0 @@
1#!/bin/sh
2
3### BEGIN INIT INFO
4# Provides: neutron-server
5# Required-Start: $remote_fs $syslog
6# Required-Stop: $remote_fs $syslog
7# Default-Start: 2 3 5
8# Default-Stop: 0 1 6
9# Short-Description: neutron-server
10# Description: Provides the Quantum networking service
11### END INIT INFO
12
13DESC="neutron-server"
14DAEMON="/usr/bin/neutron-server"
15PIDFILE="/var/run/neutron-server.pid"
16DAEMON_ARGS="--config-file=/etc/neutron/neutron.conf \
17 --config-file=@plugin@ \
18 --log-dir=/var/log/neutron"
19
20start()
21{
22 if [ -e $PIDFILE ]; then
23 PIDDIR=/proc/$(cat $PIDFILE)
24 if [ -d ${PIDDIR} ]; then
25 echo "$DESC already running."
26 exit 1
27 else
28 echo "Removing stale PID file $PIDFILE"
29 rm -f $PIDFILE
30 fi
31 fi
32
33 if [ ! -d /var/log/neutron ]; then
34 mkdir /var/log/neutron
35 fi
36
37 echo -n "Starting $DESC..."
38
39 start-stop-daemon --start --quiet --background \
40 --pidfile ${PIDFILE} --make-pidfile --exec ${DAEMON} \
41 -- $DAEMON_ARGS
42
43 if [ $? -eq 0 ]; then
44 echo "done."
45 else
46 echo "failed."
47 fi
48}
49
50stop()
51{
52 echo -n "Stopping $DESC..."
53 start-stop-daemon --stop --quiet --pidfile $PIDFILE
54 if [ $? -eq 0 ]; then
55 echo "done."
56 else
57 echo "failed."
58 fi
59 rm -f $PIDFILE
60}
61
62status()
63{
64 pid=`cat $PIDFILE 2>/dev/null`
65 if [ -n "$pid" ]; then
66 if ps -p $pid > /dev/null 2>&1 ; then
67 echo "$DESC is running"
68 return
69 fi
70 fi
71 echo "$DESC is not running"
72}
73
74reset()
75{
76 . /etc/nova/openrc
77
78 # Cleanup all neutron floating ip
79 simple_delete "neutron floatingip-list --all-tenant" "neutron floatingip-delete" 1 "neutron floatingip"
80
81 # Cleanup all neutron router
82 neutron router-list | while read line; do
83 router_id=`echo $line | get_field 1`
84 neutron router-port-list $router_id | while read line_port; do
85 port_id=`echo $line_port | get_field 1`
86 subnet_id=`echo $line_port | get_field 4 | cut -d ' ' -f 2 | cut -d '"' -f 2`
87 if [ ! -z "$router_id" ] && [ ! -z "$subnet_id" ] ; then
88 echo ">>> Delete router-port: router_id=$router_id, port_id=$port_id, subnet_id=$subnet_id"
89 neutron router-interface-delete $router_id $subnet_id > /dev/null 2>&1
90 fi
91 done
92 if [ ! -z "$router_id" ] ; then
93 echo ">>> Delete router: router_id=$router_id"
94 neutron router-delete $router_id > /dev/null 2>&1
95 fi
96 done
97
98 # Cleanup all neutron ports
99 simple_delete "neutron port-list --all-tenant" "neutron port-delete" 1 "neutron port"
100
101 # Cleanup all neutron net
102 simple_delete "neutron net-list --all-tenant" "neutron net-delete" 1 "neutron net"
103
104 stop
105
106 # This is to make sure postgres is configured and running
107 if ! pidof postmaster > /dev/null; then
108 /etc/init.d/postgresql-init
109 /etc/init.d/postgresql start
110 sleep 2
111 fi
112
113 sudo -u postgres dropdb ovs_neutron
114 sudo -u postgres createdb ovs_neutron
115
116 start
117}
118
119case "$1" in
120 start)
121 start
122 ;;
123 stop)
124 stop
125 ;;
126 restart|force-reload|reload)
127 stop
128 start
129 ;;
130 status)
131 status
132 ;;
133 reset)
134 reset
135 ;;
136 *)
137 echo "Usage: $0 {start|stop|force-reload|restart|reload|status|reset}"
138 exit 1
139 ;;
140esac
141
142exit 0