]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Adds ml2-agent daemon and package.
authorThomas Goirand <thomas@goirand.fr>
Mon, 25 Nov 2013 16:27:48 +0000 (00:27 +0800)
committerThomas Goirand <thomas@goirand.fr>
Mon, 25 Nov 2013 16:29:28 +0000 (00:29 +0800)
Change-Id: I2eb6c602d252da432d1e9be2750c9d5cdfa1d221

debian/changelog
debian/control
debian/neutron-plugin-ml2-agent.init [new file with mode: 0644]
debian/neutron-plugin-ml2-agent.logrotate [new file with mode: 0644]
debian/neutron-plugin-ml2-agent.upstart.in [new file with mode: 0644]
debian/neutron-plugin-openvswitch-agent.upstart.in

index 82d3ae4d0effd03ba63b28fff4dff719031cdf49..00bb843d5c73becc450462bbb12daf91f3fbdf6d 100644 (file)
@@ -1,7 +1,8 @@
-neutron (2013.2-5) UNRELEASED; urgency=low
+neutron (2013.2-5) unstable; urgency=low
 
   * Added missing python-babel depends in python-neutron.
   * Adds missing RabbitMQ debconf configuration code.
+  * Adds missing ml2 binary package.
 
  -- Thomas Goirand <zigo@debian.org>  Fri, 25 Oct 2013 02:07:11 +0800
 
index 438fbb9dc51f7a386519ecf2601f1a58ea8058d4..d413ddb787153cbc68bd75a495af7736294d6ff3 100644 (file)
@@ -392,6 +392,26 @@ Description: OpenStack virtual network service - Linux bridge agent
  This package provides the Linux bridge agent. If you choose to use the Linux
  bridge plugin on neutron-server, this agent should run on each compute node.
 
+Package: neutron-plugin-ml2-agent
+Architecture: all
+Pre-Depends: dpkg (>= 1.15.6~)
+Depends: bridge-utils,
+         neutron-common (= ${source:Version}),
+         sudo,
+         ${misc:Depends},
+         ${python:Depends},
+         ${shlibs:Depends}
+Breaks: python-quantum (<< 2013.2~), quantum-plugin-linuxbridge-agent (<< 2013.2~)
+Replaces: python-quantum (<< 2013.2~), quantum-plugin-linuxbridge-agent (<< 2013.2~)
+Description: OpenStack virtual network service - ML2 agent
+ Neutron provides an API to dynamically request and configure virtual networks.
+ These networks connect "interfaces" from other OpenStack services (such as
+ vNICs from Nova VMs). The Neutron API supports extensions to provide advanced
+ network capabilities, including QoS, ACLs, and network monitoring.
+ .
+ This package provides the ML2 agent. If you choose to use the ML2 plugin on
+ neutron-server, this agent should run on each compute node.
+
 Package: python-quantum
 Depends: python-neutron, ${misc:Depends}
 Architecture: all
diff --git a/debian/neutron-plugin-ml2-agent.init b/debian/neutron-plugin-ml2-agent.init
new file mode 100644 (file)
index 0000000..82fc7d4
--- /dev/null
@@ -0,0 +1,101 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides:          neutron-plugin-ml2-agent
+# Required-Start:    $network $local_fs $remote_fs $syslog openvswitch-switch
+# Required-Stop:     $remote_fs openvswitch-switch
+# 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 OpenVSwitch Agent
+# Description:       Agent to use within neutron openswitch client
+### END INIT INFO
+
+# Authors: Thomas Goirand <zigo@debian.org>
+
+# PATH should only include /usr/* if it runs after the mountnfs.sh script
+PATH=/sbin:/usr/sbin:/bin:/usr/bin
+DESC="Openstack Neutron OpenVSwitch Plugin Agent"
+NAME=neutron-ml2-agent
+DAEMON=/usr/bin/neutron-ml2-agent
+DAEMON_ARGS="--config-file=/etc/neutron/neutron.conf --config-file=/etc/neutron/plugins/ml2/ml2_conf.ini --log-file=/var/log/neutron/ml2-agent.log"
+PIDFILE=/var/run/$NAME.pid
+SCRIPTNAME=/etc/init.d/$NAME
+
+# Exit if the package is not installed
+[ -x $DAEMON ] || exit 0
+
+# Read configuration variable file if it is present
+[ -r /etc/default/$NAME ] && . /etc/default/$NAME
+
+. /lib/lsb/init-functions
+
+
+do_start()
+{
+       if [ -x /usr/bin/neutron-ovs-cleanup ] ; then
+               if [ ! -e /var/run/neutron-ovs-cleanup-performed ] ; then
+                       /usr/bin/neutron-ovs-cleanup
+                       touch /var/run/neutron-ovs-cleanup-performed
+               fi
+       fi
+       start-stop-daemon --start --background --quiet --chuid neutron:neutron --make-pidfile --pidfile $PIDFILE --startas $DAEMON --test > /dev/null \
+               || return 1
+       start-stop-daemon --start --background --quiet --chuid neutron:neutron --make-pidfile --pidfile $PIDFILE --startas $DAEMON -- \
+               $DAEMON_ARGS \
+               || return 2
+}
+
+do_stop()
+{
+       start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE
+       RETVAL="$?"
+       rm -f $PIDFILE
+       return "$RETVAL"
+}
+
+case "$1" in
+  start)
+    log_daemon_msg "Starting $DESC" "$NAME"
+    do_start
+    case "$?" in
+               0|1) log_end_msg 0 ;;
+               2) log_end_msg 1 ;;
+       esac
+  ;;
+  stop)
+       log_daemon_msg "Stopping $DESC" "$NAME"
+       do_stop
+       case "$?" in
+               0|1) log_end_msg 0 ;;
+               2) log_end_msg 1 ;;
+       esac
+       ;;
+  status)
+       status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
+       ;;
+  restart|force-reload)
+       log_daemon_msg "Restarting $DESC" "$NAME"
+       do_stop
+       case "$?" in
+         0|1)
+               do_start
+               case "$?" in
+                       0) log_end_msg 0 ;;
+                       1) log_end_msg 1 ;; # Old process is still running
+                       *) log_end_msg 1 ;; # Failed to start
+               esac
+               ;;
+         *)
+               # Failed to stop
+               log_end_msg 1
+               ;;
+       esac
+       ;;
+  *)
+       echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
+       exit 3
+       ;;
+esac
+
+:
diff --git a/debian/neutron-plugin-ml2-agent.logrotate b/debian/neutron-plugin-ml2-agent.logrotate
new file mode 100644 (file)
index 0000000..350c93e
--- /dev/null
@@ -0,0 +1,7 @@
+/var/log/neutron/ml2-agent.log {
+    daily
+    missingok
+    compress
+    delaycompress
+    notifempty
+}
diff --git a/debian/neutron-plugin-ml2-agent.upstart.in b/debian/neutron-plugin-ml2-agent.upstart.in
new file mode 100644 (file)
index 0000000..112dca7
--- /dev/null
@@ -0,0 +1,14 @@
+description "Neutron ML2 plugin agent"
+author "Thomas Goirand <zigo@debian.org>"
+
+start on runlevel [2345]
+stop on runlevel [016]
+
+chdir /var/run
+
+pre-start script
+       mkdir -p /var/run/neutron
+       chown neutron:root /var/run/neutron
+end script
+
+exec start-stop-daemon --start --chuid neutron:neutron --exec /usr/bin/neutron-ml2-agent -- --config-file=/etc/neutron/neutron.conf --config-file=/etc/neutron/plugins/ml2/ml2_conf.ini --log-file=/var/log/neutron/ml2-agent.log
index 157179289229e84e7b4271dce7591322688ab948..586620eed5013e3f478711e62f58f11385127c71 100644 (file)
@@ -11,4 +11,4 @@ pre-start script
        chown neutron:root /var/run/neutron
 end script
 
-exec start-stop-daemon --start --chuid neutron:neutron --exec /usr/bin/neutron-openvswitch-agent -- --config-file=/etc/neutron/neutron.conf --config-file=/etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini --log-file=/var/log/neutron/openvswitch-agent.log
+exec start-stop-daemon --start --chuid neutron:neutron --exec /usr/bin/neutron-openvswitch-agent -- --config-file=/etc/neutron/neutron.conf --config-file=/etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini --log-file=/var/log/neutron/ovs-agent.log