Add Neutron 7.0.0 for Ubuntu 14.04
[openstack-build/neutron-build.git] / trusty / debian / neutron-server.init.in
1 #! /bin/sh
2 ### BEGIN INIT INFO
3 # Provides:          neutron-server
4 # Required-Start:    $remote_fs $syslog
5 # Required-Stop:     $remote_fs $syslog
6 # Should-Start:      mysql postgresql rabbitmq-server keystone
7 # Should-Stop:       mysql postgresql rabbitmq-server keystone
8 # Default-Start:     2 3 4 5
9 # Default-Stop:      0 1 6
10 # Short-Description: neutron-server
11 # Description:       Provides the Neutron networking service
12 ### END INIT INFO
13
14 DESC="OpenStack Neutron Server"
15 PROJECT_NAME=neutron
16 NAME=${PROJECT_NAME}-server
17
18 ### Maintain the plugin selection so that we can load the corresponding .ini file    ###
19 ### after this, openstack-pkg-tools will add --config-file=/etc/neutron/neutron.conf ###
20 DAEMON_ARGS=""
21 [ -r /usr/share/neutron-common/plugin_guess_func ] || exit 0
22 . /usr/share/neutron-common/plugin_guess_func
23
24 if ! [ -r /etc/neutron/neutron.conf ] ; then
25         echo "Cloud not read /etc/neutron/neutron.conf: exiting"
26         exit 0
27 fi
28
29 CURRENT_PLUGIN=`grep "^[ \t]*core_plugin[ \t]*=[ \t]*[._a-zA-Z0-9]*\$" /etc/neutron/neutron.conf | sed -e 's/^[ \t]*core_plugin[ \t]*=[ \t]*//'`
30 if [ -z "${CURRENT_PLUGIN}" ] ; then
31         echo "No core_plugin= value found: please set it and try again"
32         exit 0
33 fi
34 neutron_core_plugin_to_plugin_name ${CURRENT_PLUGIN}
35 neutron_plugin_ini_path ${NEUTRON_PLUGIN_NAME}
36 if [ -z "${NEUTRON_PLUGIN_CONFIG}" ] ; then
37         echo "Plugin not recognized: please edit /etc/init.d/neutron-server to select the correct .ini file to load for your plugin"
38 else
39         DAEMON_ARGS="${DAEMON_ARGS} --config-file=${NEUTRON_PLUGIN_CONFIG}"
40         DESC="${DESC} with ${NEUTRON_PLUGIN_NAME} plugin"
41 fi
42
43 ### Neutron folders creation ###
44 mkdir -p /var/lib/neutron/tmp
45 chown neutron:neutron /var/lib/neutron/tmp
46 export TMPDIR=/var/lib/neutron/tmp