From fcc7c92859b8d65507e4f091eecc0efe10677ef9 Mon Sep 17 00:00:00 2001 From: Thomas Goirand Date: Tue, 24 Sep 2013 22:44:54 +0800 Subject: [PATCH] Added code for guessing the plugin config file to load in neutron-server upstart job. Rewritten-From: fa7b7e039f495dcc90fa6b52d13ce8f4d943e030 --- xenial/debian/neutron-server.upstart.in | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/xenial/debian/neutron-server.upstart.in b/xenial/debian/neutron-server.upstart.in index 4d1f54314..d4b62a1aa 100644 --- a/xenial/debian/neutron-server.upstart.in +++ b/xenial/debian/neutron-server.upstart.in @@ -1,5 +1,5 @@ description "Neutron server" -author "Chuck Short " +author "Thomas Goirand " start on runlevel [2345] stop on runlevel [016] @@ -12,7 +12,21 @@ pre-start script end script script - [ -r /etc/default/neutron-server ] && . /etc/default/neutron-server + [ -x /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-server -- \ --config-file /etc/neutron/neutron.conf \ -- 2.45.2