]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Fixed upstart script for the ovs agent.
authorThomas Goirand <thomas@goirand.fr>
Wed, 11 Dec 2013 02:40:43 +0000 (10:40 +0800)
committerThomas Goirand <thomas@goirand.fr>
Wed, 11 Dec 2013 02:40:43 +0000 (10:40 +0800)
Change-Id: I0c62edf13269a6fd1ddfed6b9012f17624fa0442

debian/neutron-plugin-openvswitch-agent.upstart.in

index 586620eed5013e3f478711e62f58f11385127c71..f122bd3d6efe8044d6ec28188a893db2b528e788 100644 (file)
@@ -1,5 +1,5 @@
 description "Neutron openvswitch plugin agent"
-author "Chuck Short <zulcss@ubuntu.com>"
+author "Thomas Goirand <zigo@debian.org>"
 
 start on runlevel [2345]
 stop on runlevel [016]
@@ -11,4 +11,24 @@ pre-start script
        chown neutron:root /var/run/neutron
 end script
 
-exec start-stop-daemon --start --chuid neutron:neutron --exec /usr/bin/neutron-openvswitch-agent -- --config-file=/etc/neutron/neutron.conf --config-file=/etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini --log-file=/var/log/neutron/ovs-agent.log
+script
+       [ -r /usr/share/neutron-common/plugin_guess_func ] || exit 0
+       . /usr/share/neutron-common/plugin_guess_func
+
+       if ! [ -r /etc/neutron/neutron.conf ] ; then
+               echo "Cloud not read /etc/neutron/neutron.conf: exiting"
+               exit 0
+       fi
+       CURRENT_PLUGIN=`grep "^[ \t]*core_plugin[ \t]*=[ \t]*[._a-zA-Z0-9]*\$" /etc/neutron/neutron.conf | sed -e 's/^[ \t]*core_plugin[ \t]*=[ \t]*//'`
+       if [ -z "${CURRENT_PLUGIN}" ] ; then
+               echo "No core_plugin= value found: please set it and try again"
+               exit 0
+       fi
+
+       neutron_core_plugin_to_plugin_name ${CURRENT_PLUGIN}
+       neutron_plugin_ini_path ${NEUTRON_PLUGIN_NAME}
+       [ -r "$NEUTRON_PLUGIN_CONFIG" ] && CONF_ARG="--config-file $NEUTRON_PLUGIN_CONFIG"
+       exec start-stop-daemon --start --chuid neutron:neutron --exec /usr/bin/neutron-openvswitch-agent -- \
+               --config-file=/etc/neutron/neutron.conf \
+               --log-file=/var/log/neutron/ovs-agent.log $CONF_ARG
+end script