]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Added metering and vpn binaries, fixed the neutron-server init script.
authorThomas Goirand <thomas@goirand.fr>
Tue, 24 Sep 2013 15:59:40 +0000 (23:59 +0800)
committerThomas Goirand <thomas@goirand.fr>
Tue, 24 Sep 2013 15:59:40 +0000 (23:59 +0800)
Rewritten-From: 7b3f84dd773b23d749cfcc6a228c7e32751a45df

xenial/debian/control
xenial/debian/neutron-metering-agent.init [new file with mode: 0644]
xenial/debian/neutron-metering-agent.install [new file with mode: 0644]
xenial/debian/neutron-metering-agent.logrotate [new file with mode: 0644]
xenial/debian/neutron-metering-agent.upstart.in [new file with mode: 0644]
xenial/debian/neutron-server.init
xenial/debian/neutron-server.upstart.in
xenial/debian/neutron-vpn-agent.init [new file with mode: 0644]
xenial/debian/neutron-vpn-agent.install [new file with mode: 0644]
xenial/debian/neutron-vpn-agent.logrotate [new file with mode: 0644]
xenial/debian/neutron-vpn-agent.upstart.in [new file with mode: 0644]

index 868a6483d2bd6e84830d3a639c94ae2d68d120e3..09caca274dd9a57900f2539261ec1fc481c36c44 100644 (file)
@@ -291,6 +291,46 @@ Description: OpenStack virtual network service - metadata agent
  .
  This package provides the metadata proxy agent.
 
+Package: neutron-metering-agent
+Architecture: all
+Pre-Depends: dpkg (>= 1.15.6~)
+Depends: adduser,
+         debconf,
+         lsb-base,
+         neutron-common (= ${source:Version}),
+         ${misc:Depends},
+         ${python:Depends},
+         ${shlibs:Depends}
+Breaks: quantum-server (<< 2013.2~)
+Replaces: quantum-server (<< 2013.2~)
+Description: OpenStack virtual network service - metering 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 Neutron metering agent.
+
+Package: neutron-vpn-agent
+Architecture: all
+Pre-Depends: dpkg (>= 1.15.6~)
+Depends: adduser,
+         debconf,
+         lsb-base,
+         neutron-common (= ${source:Version}),
+         ${misc:Depends},
+         ${python:Depends},
+         ${shlibs:Depends}
+Breaks: quantum-server (<< 2013.2~)
+Replaces: quantum-server (<< 2013.2~)
+Description: OpenStack virtual network service - VPN 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 Neutron VPN agent.
+
 Package: neutron-lbaas-agent
 Architecture: all
 Pre-Depends: dpkg (>= 1.15.6~)
diff --git a/xenial/debian/neutron-metering-agent.init b/xenial/debian/neutron-metering-agent.init
new file mode 100644 (file)
index 0000000..120f7ef
--- /dev/null
@@ -0,0 +1,90 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides:          neutron-metering-agent
+# Required-Start:    $network $local_fs $remote_fs $syslog
+# Required-Stop:     $remote_fs
+# Should-Start:      mysql postgresql rabbitmq-server keystone openvswitch-switch
+# Should-Stop:       mysql postgresql rabbitmq-server keystone openvswitch-switch
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Neutron Metering Agent agent
+# Description:       Provides Metering agent for neutron
+### END INIT INFO
+
+# Author: 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 Metering Agent"
+NAME=neutron-metering-agent
+DAEMON=/usr/bin/${NAME}
+DAEMON_ARGS="--config-file=/etc/neutron/neutron.conf --config-file=/etc/neutron/metering_agent.ini --log-file=/var/log/neutron/metering-agent.log"
+PIDFILE=/var/run/$NAME.pid
+SCRIPTNAME=/etc/init.d/$NAME
+
+# Exit if the package is not installed
+[ -x $DAEMON ] || exit 0
+
+. /lib/lsb/init-functions
+
+do_start()
+{
+       start-stop-daemon --start --quiet --background --chuid neutron:neutron --make-pidfile --pidfile $PIDFILE --startas $DAEMON --test > /dev/null \
+               || return 1
+       start-stop-daemon --start --quiet --background --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/xenial/debian/neutron-metering-agent.install b/xenial/debian/neutron-metering-agent.install
new file mode 100644 (file)
index 0000000..da7be40
--- /dev/null
@@ -0,0 +1 @@
+etc/metering_agent.ini etc/neutron
diff --git a/xenial/debian/neutron-metering-agent.logrotate b/xenial/debian/neutron-metering-agent.logrotate
new file mode 100644 (file)
index 0000000..4516cf8
--- /dev/null
@@ -0,0 +1,7 @@
+/var/log/neutron/metering-agent.log {
+    daily
+    missingok
+    compress
+    delaycompress
+    notifempty
+}
diff --git a/xenial/debian/neutron-metering-agent.upstart.in b/xenial/debian/neutron-metering-agent.upstart.in
new file mode 100644 (file)
index 0000000..f233be9
--- /dev/null
@@ -0,0 +1,16 @@
+description "Neutron Metering 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-metering-agent -- \
+            --config-file=/etc/neutron/neutron.conf --config-file=/etc/neutron/metering_agent.ini \
+            --log-file=/var/log/neutron/metering-agent.log
index 3beb8ec1c528bd44a87db4f7cd53cd1044d03ed1..67d35201525622e2cf4368f678b90c15169f09cd 100644 (file)
@@ -26,7 +26,7 @@ DAEMON_ARGS="--config-file=/etc/neutron/neutron.conf --log-file=$LOGFILE"
 
 . /lib/lsb/init-functions
 
-[ -x /usr/share/neutron-common/plugin_guess_func ] || exit 0
+[ -r /usr/share/neutron-common/plugin_guess_func ] || exit 0
 . /usr/share/neutron-common/plugin_guess_func
 
 ### Maintain the plugin selection so that we can load the corresponding .ini file ###
index d4b62a1aa01ed8f6701fcf4ffab5904c58e92c89..5ed83cc2b1b6f44f7f869c365a297ef970d2231d 100644 (file)
@@ -12,7 +12,7 @@ pre-start script
 end script
 
 script
-       [ -x /usr/share/neutron-common/plugin_guess_func ] || exit 0
+       [ -r /usr/share/neutron-common/plugin_guess_func ] || exit 0
        . /usr/share/neutron-common/plugin_guess_func
 
        if ! [ -r /etc/neutron/neutron.conf ] ; then
diff --git a/xenial/debian/neutron-vpn-agent.init b/xenial/debian/neutron-vpn-agent.init
new file mode 100644 (file)
index 0000000..d0980cb
--- /dev/null
@@ -0,0 +1,90 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides:          neutron-vpn-agent
+# Required-Start:    $network $local_fs $remote_fs $syslog
+# Required-Stop:     $remote_fs
+# Should-Start:      mysql postgresql rabbitmq-server keystone openvswitch-switch
+# Should-Stop:       mysql postgresql rabbitmq-server keystone openvswitch-switch
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Neutron VPN Agent agent
+# Description:       Provides VPN agent for neutron
+### END INIT INFO
+
+# Author: 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 VPN Agent"
+NAME=neutron-vpn-agent
+DAEMON=/usr/bin/${NAME}
+DAEMON_ARGS="--config-file=/etc/neutron/neutron.conf --config-file=/etc/neutron/vpn_agent.ini --log-file=/var/log/neutron/vpn-agent.log"
+PIDFILE=/var/run/$NAME.pid
+SCRIPTNAME=/etc/init.d/$NAME
+
+# Exit if the package is not installed
+[ -x $DAEMON ] || exit 0
+
+. /lib/lsb/init-functions
+
+do_start()
+{
+       start-stop-daemon --start --quiet --background --chuid neutron:neutron --make-pidfile --pidfile $PIDFILE --startas $DAEMON --test > /dev/null \
+               || return 1
+       start-stop-daemon --start --quiet --background --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/xenial/debian/neutron-vpn-agent.install b/xenial/debian/neutron-vpn-agent.install
new file mode 100644 (file)
index 0000000..6cdb8e7
--- /dev/null
@@ -0,0 +1 @@
+etc/vpn_agent.ini etc/neutron
diff --git a/xenial/debian/neutron-vpn-agent.logrotate b/xenial/debian/neutron-vpn-agent.logrotate
new file mode 100644 (file)
index 0000000..ac7a112
--- /dev/null
@@ -0,0 +1,7 @@
+/var/log/neutron/vpn-agent.log {
+    daily
+    missingok
+    compress
+    delaycompress
+    notifempty
+}
diff --git a/xenial/debian/neutron-vpn-agent.upstart.in b/xenial/debian/neutron-vpn-agent.upstart.in
new file mode 100644 (file)
index 0000000..888fa30
--- /dev/null
@@ -0,0 +1,16 @@
+description "Neutron VPN 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-vpn-agent -- \
+            --config-file=/etc/neutron/neutron.conf --config-file=/etc/neutron/vpn_agent.ini \
+            --log-file=/var/log/neutron/vpn-agent.log