Add Neutron 7.0.0 for Ubuntu 14.04
[openstack-build/neutron-build.git] / trusty / debian / neutron-plugin-openvswitch-agent.upstart.in
1 description "Neutron openvswitch plugin agent"
2 author "Thomas Goirand <zigo@debian.org>"
3
4 start on runlevel [2345]
5 stop on runlevel [016]
6
7 chdir /var/run
8
9 pre-start script
10         mkdir -p /var/run/neutron
11         chown neutron:root /var/run/neutron
12 end script
13
14 script
15         [ -r /usr/share/neutron-common/plugin_guess_func ] || exit 0
16         . /usr/share/neutron-common/plugin_guess_func
17
18         if ! [ -r /etc/neutron/neutron.conf ] ; then
19                 echo "Cloud not read /etc/neutron/neutron.conf: exiting"
20                 exit 0
21         fi
22         CURRENT_PLUGIN=`grep "^[ \t]*core_plugin[ \t]*=[ \t]*[._a-zA-Z0-9]*\$" /etc/neutron/neutron.conf | sed -e 's/^[ \t]*core_plugin[ \t]*=[ \t]*//'`
23         if [ -z "${CURRENT_PLUGIN}" ] ; then
24                 echo "No core_plugin= value found: please set it and try again"
25                 exit 0
26         fi
27
28         neutron_core_plugin_to_plugin_name ${CURRENT_PLUGIN}
29         neutron_plugin_ini_path ${NEUTRON_PLUGIN_NAME}
30         [ -r "$NEUTRON_PLUGIN_CONFIG" ] && CONF_ARG="--config-file $NEUTRON_PLUGIN_CONFIG"
31         [ -r /etc/default/openstack ] && . /etc/default/openstack
32         [ -r /etc/default/$UPSTART_JOB ] && . /etc/default/$UPSTART_JOB
33
34         [ "x$USE_SYSLOG" = "xyes" ] && DAEMON_ARGS="$DAEMON_ARGS --use-syslog"
35         [ "x$USE_LOGFILE" != "xno" ] && DAEMON_ARGS="$DAEMON_ARGS --log-file=/var/log/neutron/ovs-agent.log"
36         exec start-stop-daemon --start --chuid neutron:neutron --exec /usr/bin/neutron-openvswitch-agent -- \
37                 --config-file=/etc/neutron/neutron.conf \
38                 $CONF_ARG $DAEMON_ARGS
39 end script