X-Git-Url: https://review.fuel-infra.org/gitweb?p=openstack-build%2Fneutron-build.git;a=blobdiff_plain;f=xenial%2Fdebian%2Fneutron-server.init.in;fp=xenial%2Fdebian%2Fneutron-server.init.in;h=819f38bd9af9dcbbd51edea8a298a6763012c625;hp=0000000000000000000000000000000000000000;hb=3421ecb02ab9522576c94908232ecdbc26f8c44d;hpb=1acf7e94e6878f9dad74b1bf951bc62e7c4b66b9 diff --git a/xenial/debian/neutron-server.init.in b/xenial/debian/neutron-server.init.in new file mode 100644 index 000000000..819f38bd9 --- /dev/null +++ b/xenial/debian/neutron-server.init.in @@ -0,0 +1,51 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: neutron-server +# Required-Start: $remote_fs $syslog +# Required-Stop: $remote_fs $syslog +# Should-Start: mysql postgresql rabbitmq-server keystone +# Should-Stop: mysql postgresql rabbitmq-server keystone +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: neutron-server +# Description: Provides the Neutron networking service +### END INIT INFO + +DESC="OpenStack Neutron Server" +PROJECT_NAME=neutron +NAME=${PROJECT_NAME}-server + +### Maintain the plugin selection so that we can load the corresponding .ini file ### +### after this, openstack-pkg-tools will add --config-file=/etc/neutron/neutron.conf ### +DAEMON_ARGS="" +[ -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} +if [ -z "${NEUTRON_PLUGIN_CONFIG}" ] ; then + echo "Plugin not recognized: please edit /etc/init.d/neutron-server to select the correct .ini file to load for your plugin" +else + DAEMON_ARGS="${DAEMON_ARGS} --config-file=${NEUTRON_PLUGIN_CONFIG}" + DESC="${DESC} with ${NEUTRON_PLUGIN_NAME} plugin" +fi + +# If neutron-fwaas-l3-agent is installed, then we want to activate fwaas +if [ -r /etc/neutron/fwaas_driver.ini ] ; then + DAEMON_ARGS="${DAEMON_ARGS} --config-file=/etc/neutron/fwaas_driver.ini" +fi + +### Neutron folders creation ### +mkdir -p /var/lib/neutron/tmp +chown neutron:neutron /var/lib/neutron/tmp +export TMPDIR=/var/lib/neutron/tmp