Comment 3 for bug 1485422

Revision history for this message
Christoph Fiehe (fiehe) wrote :

Actually neutron-ovs-cleanup should be started after the startup of the OVS service:

neutron-ovs-cleanup.conf
##############################################################################
start on started openvswitch-switch
stop on runlevel [!2345]

pre-start script
  # sleep 5
  [ ! -x /usr/bin/neutron-ovs-cleanup ] && exit 0
  start-stop-daemon --start --chuid neutron --exec /usr/bin/neutron-ovs-cleanup -- \
    --log-file /var/log/neutron/ovs-cleanup.log \
    --config-file /etc/neutron/neutron.conf --verbose
end script

I don't know why the neutron-l3-agent and the neutron-dhcp-agent upstart scripts use a different pattern and why they get started even when neutron-ovs-cleanup has failed.

neutron-l3-agent.conf:
##############################################################################
start on runlevel [2345]
stop on runlevel [!2345]

respawn

chdir /var/run

pre-start script
  mkdir -p /var/run/neutron
  chown neutron:root /var/run/neutron
  # Check to see if openvswitch plugin in use by checking
  # status of cleanup upstart configuration
  if status neutron-ovs-cleanup; then
    start wait-for-state WAIT_FOR=neutron-ovs-cleanup WAIT_STATE=running WAITER=neutron-l3-agent
  fi
end script

exec start-stop-daemon --start --chuid neutron --exec /usr/bin/neutron-l3-agent -- \
  --config-file=/etc/neutron/neutron.conf --config-file=/etc/neutron/l3_agent.ini \
  --config-file=/etc/neutron/fwaas_driver.ini --log-file=/var/log/neutron/l3-agent.log

neutron-dhcp-agent.conf:
##############################################################################
description "Neutron DHCP Agent"
author "Chuck Short <email address hidden>"

start on runlevel [2345]
stop on runlevel [!2345]

respawn

chdir /var/run

pre-start script
  mkdir -p /var/run/neutron
  chown neutron:root /var/run/neutron
  # Check to see if openvswitch plugin in use by checking
  # status of cleanup upstart configuration
  if status neutron-ovs-cleanup; then
    start wait-for-state WAIT_FOR=neutron-ovs-cleanup WAIT_STATE=running WAITER=neutron-dhcp-agent
  fi
end script

exec start-stop-daemon --start --chuid neutron --exec /usr/bin/neutron-dhcp-agent -- --config-file=/etc/neutron/neutron.conf --config-file=/etc/neutron/dhcp_agent.ini --log-file=/var/log/neutron/dhcp-agent.log