[PKG-Openstack-devel] PATCH] Allow selecting log destination for Neutron daemons

Sylvain Baubeau sylvain.baubeau at enovance.com
Mon Apr 7 16:41:04 UTC 2014


Hi list,

This patch implements the same behaviour as http://lists.alioth.debian.org/pipermail/openstack-devel/2014-April/005259.html for Neutron daemons.

Greetings,
Sylvain B.


commit e70c74055a4912ec3dc877d9c8168c0b4d778a60
Author: Sylvain Baubeau <sylvain.baubeau at enovance.com>
Date:   Mon Apr 7 17:38:58 2014 +0200

    Allow selecting log destination for Openstack daemons

diff --git a/debian/neutron-dhcp-agent.init b/debian/neutron-dhcp-agent.init
index a2d45bd..45e5dfb 100644
--- a/debian/neutron-dhcp-agent.init
+++ b/debian/neutron-dhcp-agent.init
@@ -18,7 +18,7 @@ PATH=/sbin:/usr/sbin:/bin:/usr/bin
 DESC="OpenStack Neutron DHCP agent"
 NAME=neutron-dhcp-agent
 DAEMON=/usr/bin/neutron-dhcp-agent
-DAEMON_ARGS="--config-file=/etc/neutron/neutron.conf --config-file=/etc/neutron/dhcp_agent.ini --log-file=/var/log/neutron/dhcp-agent.log"
+DAEMON_ARGS="--config-file=/etc/neutron/neutron.conf --config-file=/etc/neutron/dhcp_agent.ini"
 PIDFILE=/var/run/$NAME.pid
 SCRIPTNAME=/etc/init.d/$NAME
 
@@ -27,6 +27,12 @@ SCRIPTNAME=/etc/init.d/$NAME
 
 . /lib/lsb/init-functions
 
+[ -r /etc/default/openstack ] && . /etc/default/openstack
+[ -r /etc/default/$NAME ] && . /etc/default/$NAME
+
+[ "x$USE_SYSLOG" = "xyes" ] && DAEMON_ARGS="$DAEMON_ARGS --use-syslog"
+[ "x$USE_LOGFILE" != "xno" ] && DAEMON_ARGS="$DAEMON_ARGS --log-file=/var/log/neutron/dhcp-agent.log"
+
 do_start()
 {
 	start-stop-daemon --start --quiet --background --chuid neutron:neutron --make-pidfile --pidfile $PIDFILE --startas $DAEMON --test > /dev/null \
diff --git a/debian/neutron-dhcp-agent.upstart.in b/debian/neutron-dhcp-agent.upstart.in
index 9e5504a..3170cdf 100644
--- a/debian/neutron-dhcp-agent.upstart.in
+++ b/debian/neutron-dhcp-agent.upstart.in
@@ -11,4 +11,14 @@ pre-start script
         chown neutron:root /var/run/neutron
 end script
 
-exec start-stop-daemon --start --chuid neutron: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
+script
+	[ -r /etc/default/openstack ] && . /etc/default/openstack
+	[ -r /etc/default/$UPSTART_JOB ] && . /etc/default/$UPSTART_JOB
+
+	[ "x$USE_SYSLOG" = "xyes" ] && DAEMON_ARGS="$DAEMON_ARGS --use-syslog"
+	[ "x$USE_LOGFILE" != "xno" ] && DAEMON_ARGS="$DAEMON_ARGS --log-file=/var/log/neutron/dhcp-agent.log"
+
+	exec start-stop-daemon --start --chuid neutron:neutron --exec /usr/bin/neutron-dhcp-agent -- \
+	                       --config-file=/etc/neutron/neutron.conf --config-file=/etc/neutron/dhcp_agent.ini \
+	                       $DAEMON_ARGS
+end script
diff --git a/debian/neutron-l3-agent.init b/debian/neutron-l3-agent.init
index 948f386..5c7bf0e 100644
--- a/debian/neutron-l3-agent.init
+++ b/debian/neutron-l3-agent.init
@@ -19,7 +19,7 @@ PATH=/sbin:/usr/sbin:/bin:/usr/bin
 DESC="OpenStack Neutron L3 agent"
 NAME=neutron-l3-agent
 DAEMON=/usr/bin/neutron-l3-agent
-DAEMON_ARGS="--config-file=/etc/neutron/neutron.conf --config-file=/etc/neutron/l3_agent.ini --log-file=/var/log/neutron/l3-agent.log"
+DAEMON_ARGS="--config-file=/etc/neutron/neutron.conf --config-file=/etc/neutron/l3_agent.ini"
 PIDFILE=/var/run/$NAME.pid
 SCRIPTNAME=/etc/init.d/$NAME
 
@@ -28,6 +28,12 @@ SCRIPTNAME=/etc/init.d/$NAME
 
 . /lib/lsb/init-functions
 
+[ -r /etc/default/openstack ] && . /etc/default/openstack
+[ -r /etc/default/$NAME ] && . /etc/default/$NAME
+
+[ "x$USE_SYSLOG" = "xyes" ] && DAEMON_ARGS="$DAEMON_ARGS --use-syslog"
+[ "x$USE_LOGFILE" != "xno" ] && DAEMON_ARGS="$DAEMON_ARGS --log-file=/var/log/neutron/l3-agent.log"
+
 do_start()
 {
 	start-stop-daemon --start --quiet --background --chuid neutron:neutron --make-pidfile --pidfile $PIDFILE --startas $DAEMON --test > /dev/null \
diff --git a/debian/neutron-l3-agent.upstart.in b/debian/neutron-l3-agent.upstart.in
index 9e10945..019c5ae 100644
--- a/debian/neutron-l3-agent.upstart.in
+++ b/debian/neutron-l3-agent.upstart.in
@@ -11,4 +11,14 @@ pre-start script
 	chown neutron:root /var/run/neutron
 end script
 
-exec start-stop-daemon --start --chuid neutron:neutron --exec /usr/bin/neutron-l3-agent -- --config-file=/etc/neutron/neutron.conf --config-file=/etc/neutron/l3_agent.ini --log-file=/var/log/neutron/l3-agent.log
+script
+	[ -r /etc/default/openstack ] && . /etc/default/openstack
+	[ -r /etc/default/$UPSTART_JOB ] && . /etc/default/$UPSTART_JOB
+
+	[ "x$USE_SYSLOG" = "xyes" ] && DAEMON_ARGS="$DAEMON_ARGS --use-syslog"
+	[ "x$USE_LOGFILE" != "xno" ] && DAEMON_ARGS="$DAEMON_ARGS --log-file=/var/log/neutron/l3-agent.log"
+
+	exec start-stop-daemon --start --chuid neutron:neutron --exec /usr/bin/neutron-l3-agent -- \
+	                       --config-file=/etc/neutron/neutron.conf --config-file=/etc/neutron/l3_agent.ini \
+	                       $DAEMON_ARGS
+end script
diff --git a/debian/neutron-lbaas-agent.init b/debian/neutron-lbaas-agent.init
index 78b4d91..0d73a67 100644
--- a/debian/neutron-lbaas-agent.init
+++ b/debian/neutron-lbaas-agent.init
@@ -18,7 +18,7 @@ PATH=/sbin:/usr/sbin:/bin:/usr/bin
 DESC="OpenStack Neutron LBaaS agent"
 NAME=neutron-lbaas-agent
 DAEMON=/usr/bin/${NAME}
-DAEMON_ARGS="--config-file=/etc/neutron/lbaas_agent.ini --config-file=/etc/neutron/neutron.conf --log-file=/var/log/neutron/lbaas-agent.log"
+DAEMON_ARGS="--config-file=/etc/neutron/lbaas_agent.ini --config-file=/etc/neutron/neutron.conf"
 PIDFILE=/var/run/$NAME.pid
 SCRIPTNAME=/etc/init.d/$NAME
 
@@ -27,6 +27,12 @@ SCRIPTNAME=/etc/init.d/$NAME
 
 . /lib/lsb/init-functions
 
+[ -r /etc/default/openstack ] && . /etc/default/openstack
+[ -r /etc/default/$NAME ] && . /etc/default/$NAME
+
+[ "x$USE_SYSLOG" = "xyes" ] && DAEMON_ARGS="$DAEMON_ARGS --use-syslog"
+[ "x$USE_LOGFILE" != "xno" ] && DAEMON_ARGS="$DAEMON_ARGS --log-file=/var/log/neutron/lbaas-agent.log"
+
 do_start()
 {
 	start-stop-daemon --start --quiet --background --chuid neutron:neutron --make-pidfile --pidfile $PIDFILE --startas $DAEMON --test > /dev/null \
diff --git a/debian/neutron-lbaas-agent.upstart.in b/debian/neutron-lbaas-agent.upstart.in
index 21ee48f..35f1893 100644
--- a/debian/neutron-lbaas-agent.upstart.in
+++ b/debian/neutron-lbaas-agent.upstart.in
@@ -11,4 +11,14 @@ pre-start script
         chown neutron:root /var/run/neutron
 end script
 
-exec start-stop-daemon --start --chuid neutron:neutron --exec /usr/bin/neutron-lbaas-agent -- --config-file=/etc/neutron/lbaas_agent.ini --config-file=/etc/neutron/neutron.conf --log-file=/var/log/neutron/lbaas-agent.log
+script
+	[ -r /etc/default/openstack ] && . /etc/default/openstack
+	[ -r /etc/default/$UPSTART_JOB ] && . /etc/default/$UPSTART_JOB
+
+	[ "x$USE_SYSLOG" = "xyes" ] && DAEMON_ARGS="$DAEMON_ARGS --use-syslog"
+	[ "x$USE_LOGFILE" != "xno" ] && DAEMON_ARGS="$DAEMON_ARGS --log-file=/var/log/neutron/lbaas-agent.log"
+
+	exec start-stop-daemon --start --chuid neutron:neutron --exec /usr/bin/neutron-lbaas-agent -- \
+	                       --config-file=/etc/neutron/lbaas_agent.ini --config-file=/etc/neutron/neutron.conf \
+	                       $DAEMON_ARGS
+end script
diff --git a/debian/neutron-metadata-agent.init b/debian/neutron-metadata-agent.init
index 8168e52..796549a 100644
--- a/debian/neutron-metadata-agent.init
+++ b/debian/neutron-metadata-agent.init
@@ -18,7 +18,7 @@ PATH=/sbin:/usr/sbin:/bin:/usr/bin
 DESC="OpenStack Neutron Metadata Agent"
 NAME=neutron-metadata-agent
 DAEMON=/usr/bin/${NAME}
-DAEMON_ARGS="--config-file=/etc/neutron/neutron.conf --config-file=/etc/neutron/metadata_agent.ini --log-file=/var/log/neutron/metadata-agent.log"
+DAEMON_ARGS="--config-file=/etc/neutron/neutron.conf --config-file=/etc/neutron/metadata_agent.ini"
 PIDFILE=/var/run/$NAME.pid
 SCRIPTNAME=/etc/init.d/$NAME
 
@@ -27,6 +27,12 @@ SCRIPTNAME=/etc/init.d/$NAME
 
 . /lib/lsb/init-functions
 
+[ -r /etc/default/openstack ] && . /etc/default/openstack
+[ -r /etc/default/$NAME ] && . /etc/default/$NAME
+
+[ "x$USE_SYSLOG" = "xyes" ] && DAEMON_ARGS="$DAEMON_ARGS --use-syslog"
+[ "x$USE_LOGFILE" != "xno" ] && DAEMON_ARGS="$DAEMON_ARGS --log-file=/var/log/neutron/metadata-agent.log"
+
 do_start()
 {
 	start-stop-daemon --start --quiet --background --chuid neutron:neutron --make-pidfile --pidfile $PIDFILE --startas $DAEMON --test > /dev/null \
diff --git a/debian/neutron-metadata-agent.upstart.in b/debian/neutron-metadata-agent.upstart.in
index 9831145..1af2195 100644
--- a/debian/neutron-metadata-agent.upstart.in
+++ b/debian/neutron-metadata-agent.upstart.in
@@ -11,6 +11,14 @@ pre-start script
 	chown neutron:root /var/run/neutron
 end script
 
-exec start-stop-daemon --start --chuid neutron:neutron --exec /usr/bin/neutron-metadata-agent -- \
-            --config-file=/etc/neutron/neutron.conf --config-file=/etc/neutron/metadata_agent.ini \
-            --log-file=/var/log/neutron/metadata-agent.log
+script
+	[ -r /etc/default/openstack ] && . /etc/default/openstack
+	[ -r /etc/default/$UPSTART_JOB ] && . /etc/default/$UPSTART_JOB
+
+	[ "x$USE_SYSLOG" = "xyes" ] && DAEMON_ARGS="$DAEMON_ARGS --use-syslog"
+	[ "x$USE_LOGFILE" != "xno" ] && DAEMON_ARGS="$DAEMON_ARGS --log-file=/var/log/neutron/metadata-agent.log"
+
+	exec start-stop-daemon --start --chuid neutron:neutron --exec /usr/bin/neutron-metadata-agent -- \
+                           --config-file=/etc/neutron/neutron.conf --config-file=/etc/neutron/metadata_agent.ini \
+                           $DAEMON_ARGS
+end script
diff --git a/debian/neutron-metering-agent.init b/debian/neutron-metering-agent.init
index 120f7ef..8fb4653 100644
--- a/debian/neutron-metering-agent.init
+++ b/debian/neutron-metering-agent.init
@@ -18,7 +18,7 @@ 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"
+DAEMON_ARGS="--config-file=/etc/neutron/neutron.conf --config-file=/etc/neutron/metering_agent.ini"
 PIDFILE=/var/run/$NAME.pid
 SCRIPTNAME=/etc/init.d/$NAME
 
@@ -27,6 +27,12 @@ SCRIPTNAME=/etc/init.d/$NAME
 
 . /lib/lsb/init-functions
 
+[ -r /etc/default/openstack ] && . /etc/default/openstack
+[ -r /etc/default/$NAME ] && . /etc/default/$NAME
+
+[ "x$USE_SYSLOG" = "xyes" ] && DAEMON_ARGS="$DAEMON_ARGS --use-syslog"
+[ "x$USE_LOGFILE" != "xno" ] && DAEMON_ARGS="$DAEMON_ARGS --log-file=/var/log/neutron/metering-agent.log"
+
 do_start()
 {
 	start-stop-daemon --start --quiet --background --chuid neutron:neutron --make-pidfile --pidfile $PIDFILE --startas $DAEMON --test > /dev/null \
diff --git a/debian/neutron-metering-agent.upstart.in b/debian/neutron-metering-agent.upstart.in
index f233be9..888a2cf 100644
--- a/debian/neutron-metering-agent.upstart.in
+++ b/debian/neutron-metering-agent.upstart.in
@@ -11,6 +11,14 @@ pre-start script
 	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
+script
+	[ -r /etc/default/openstack ] && . /etc/default/openstack
+	[ -r /etc/default/$UPSTART_JOB ] && . /etc/default/$UPSTART_JOB
+
+	[ "x$USE_SYSLOG" = "xyes" ] && DAEMON_ARGS="$DAEMON_ARGS --use-syslog"
+	[ "x$USE_LOGFILE" != "xno" ] && DAEMON_ARGS="$DAEMON_ARGS --log-file=/var/log/neutron/metering-agent.log"
+
+	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 \
+                           $DAEMON_ARGS
+end script
diff --git a/debian/neutron-plugin-linuxbridge-agent.upstart.in b/debian/neutron-plugin-linuxbridge-agent.upstart.in
index 44e2ead..b720f9c 100644
--- a/debian/neutron-plugin-linuxbridge-agent.upstart.in
+++ b/debian/neutron-plugin-linuxbridge-agent.upstart.in
@@ -11,4 +11,14 @@ pre-start script
 	chown neutron:root /var/run/neutron
 end script
 
-exec start-stop-daemon --start --chuid neutron:neutron --exec /usr/bin/neutron-linuxbridge-agent -- --config-file=/etc/neutron/neutron.conf --config-file=/etc/neutron/plugins/linuxbridge/linuxbridge_conf.ini --log-file=/var/log/neutron/linuxbridge-agent.log
+script
+	[ -r /etc/default/openstack ] && . /etc/default/openstack
+	[ -r /etc/default/$UPSTART_JOB ] && . /etc/default/$UPSTART_JOB
+
+	[ "x$USE_SYSLOG" = "xyes" ] && DAEMON_ARGS="$DAEMON_ARGS --use-syslog"
+	[ "x$USE_LOGFILE" != "xno" ] && DAEMON_ARGS="$DAEMON_ARGS --log-file=/var/log/neutron/linuxbridge-agent.log"
+
+	exec start-stop-daemon --start --chuid neutron:neutron --exec /usr/bin/neutron-linuxbridge-agent -- \
+	                       --config-file=/etc/neutron/neutron.conf --config-file=/etc/neutron/plugins/linuxbridge/linuxbridge_conf.ini \
+	                       $DAEMON_ARGS
+end script
diff --git a/debian/neutron-plugin-nec-agent.upstart.in b/debian/neutron-plugin-nec-agent.upstart.in
index 2ec450f..bd13690 100644
--- a/debian/neutron-plugin-nec-agent.upstart.in
+++ b/debian/neutron-plugin-nec-agent.upstart.in
@@ -11,4 +11,14 @@ pre-start script
 	chown neutron:root /var/run/neutron
 end script
 
-exec start-stop-daemon --start --chuid neutron:neutron --exec /usr/bin/neutron-nec-agent -- --config-file=/etc/neutron/neutron.conf --config-file=/etc/neutron/plugins/nec/nec.ini --log-file=/var/log/neutron/nec-agent.log
+script
+	[ -r /etc/default/openstack ] && . /etc/default/openstack
+	[ -r /etc/default/$UPSTART_JOB ] && . /etc/default/$UPSTART_JOB
+
+	[ "x$USE_SYSLOG" = "xyes" ] && DAEMON_ARGS="$DAEMON_ARGS --use-syslog"
+	[ "x$USE_LOGFILE" != "xno" ] && DAEMON_ARGS="$DAEMON_ARGS --log-file=/var/log/neutron/nec-agent.log"
+
+	exec start-stop-daemon --start --chuid neutron:neutron --exec /usr/bin/neutron-nec-agent -- \
+	                       --config-file=/etc/neutron/neutron.conf --config-file=/etc/neutron/plugins/nec/nec.ini \
+	                       $DAEMON_ARGS
+end script
diff --git a/debian/neutron-plugin-openvswitch-agent.init b/debian/neutron-plugin-openvswitch-agent.init
index 96b2751..640bd94 100644
--- a/debian/neutron-plugin-openvswitch-agent.init
+++ b/debian/neutron-plugin-openvswitch-agent.init
@@ -18,7 +18,7 @@ PATH=/sbin:/usr/sbin:/bin:/usr/bin
 DESC="Openstack Neutron OpenVSwitch Plugin Agent"
 NAME=neutron-openvswitch-agent
 DAEMON=/usr/bin/neutron-openvswitch-agent
-DAEMON_ARGS="--config-file=/etc/neutron/neutron.conf --log-file=/var/log/neutron/ovs-agent.log"
+DAEMON_ARGS="--config-file=/etc/neutron/neutron.conf"
 PIDFILE=/var/run/$NAME.pid
 SCRIPTNAME=/etc/init.d/$NAME
 CONF_FILE=/etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini
@@ -27,8 +27,12 @@ CONF_FILE=/etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini
 [ -x $DAEMON ] || exit 0
 
 # Read configuration variable file if it is present
+[ -r /etc/default/openstack ] && . /etc/default/openstack
 [ -r /etc/default/$NAME ] && . /etc/default/$NAME
 
+[ "x$USE_SYSLOG" = "xyes" ] && DAEMON_ARGS="${DAEMON_ARGS} --use-syslog"
+[ "x$USE_LOGFILE" != "xno" ] && DAEMON_ARGS="${DAEMON_ARGS} --log-file=/var/log/neutron/ovs-agent.log"
+
 . /lib/lsb/init-functions
 
 [ -r /usr/share/neutron-common/plugin_guess_func ] || exit 0
diff --git a/debian/neutron-plugin-openvswitch-agent.upstart.in b/debian/neutron-plugin-openvswitch-agent.upstart.in
index 586620e..22b8038 100644
--- a/debian/neutron-plugin-openvswitch-agent.upstart.in
+++ b/debian/neutron-plugin-openvswitch-agent.upstart.in
@@ -11,4 +11,14 @@ 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/ovs-agent.log
+script
+	[ -r /etc/default/openstack ] && . /etc/default/openstack
+	[ -r /etc/default/$UPSTART_JOB ] && . /etc/default/$UPSTART_JOB
+
+	[ "x$USE_SYSLOG" = "xyes" ] && DAEMON_ARGS="$DAEMON_ARGS --use-syslog"
+	[ "x$USE_LOGFILE" != "xno" ] && DAEMON_ARGS="$DAEMON_ARGS --log-file=/var/log/neutron/ovs-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 \
+	                       $DAEMON_ARGS
+end script
diff --git a/debian/neutron-plugin-ryu-agent.upstart.in b/debian/neutron-plugin-ryu-agent.upstart.in
index 39e1491..e30c504 100644
--- a/debian/neutron-plugin-ryu-agent.upstart.in
+++ b/debian/neutron-plugin-ryu-agent.upstart.in
@@ -11,4 +11,14 @@ pre-start script
 	chown neutron:root /var/run/neutron
 end script
 
-exec start-stop-daemon --start --chuid neutron:neutron --exec /usr/bin/neutron-ryu-agent -- --config-file=/etc/neutron/neutron.conf --config-file=/etc/neutron/plugins/ryu/ryu.ini --log-file=/var/log/neutron/ryu-agent.log
+script
+	[ -r /etc/default/openstack ] && . /etc/default/openstack
+	[ -r /etc/default/$UPSTART_JOB ] && . /etc/default/$UPSTART_JOB
+
+	[ "x$USE_SYSLOG" = "xyes" ] && DAEMON_ARGS="$DAEMON_ARGS --use-syslog"
+	[ "x$USE_LOGFILE" != "xno" ] && DAEMON_ARGS="$DAEMON_ARGS --log-file=/var/log/neutron/ryu-agent.log"
+
+	exec start-stop-daemon --start --chuid neutron:neutron --exec /usr/bin/neutron-ryu-agent -- \
+	                       --config-file=/etc/neutron/neutron.conf --config-file=/etc/neutron/plugins/ryu/ryu.in \
+	                       $DAEMON_ARGS
+end script
diff --git a/debian/neutron-server.init b/debian/neutron-server.init
index 67d3520..741ca48 100644
--- a/debian/neutron-server.init
+++ b/debian/neutron-server.init
@@ -19,13 +19,19 @@ PIDFILE=/var/run/neutron/${NAME}.pid
 SCRIPTNAME=/etc/init.d/${NAME}
 LOGFILE=/var/log/neutron/neutron-server.log
 DAEMON_DIR=/var/run
-DAEMON_ARGS="--config-file=/etc/neutron/neutron.conf --log-file=$LOGFILE"
+DAEMON_ARGS="--config-file=/etc/neutron/neutron.conf"
 
 # Exit if the package is not installed
 [ -x $DAEMON ] || exit 0
 
 . /lib/lsb/init-functions
 
+[ -r /etc/default/openstack ] && . /etc/default/openstack
+[ -r /etc/default/$NAME ] && . /etc/default/$NAME
+
+[ "x$USE_SYSLOG" = "xyes" ] && DAEMON_ARGS="$DAEMON_ARGS --use-syslog"
+[ "x$USE_LOGFILE" != "xno" ] && DAEMON_ARGS="$DAEMON_ARGS --log-file=$LOGFILE"
+
 [ -r /usr/share/neutron-common/plugin_guess_func ] || exit 0
 . /usr/share/neutron-common/plugin_guess_func
 
diff --git a/debian/neutron-server.upstart.in b/debian/neutron-server.upstart.in
index 5ed83cc..ff39720 100644
--- a/debian/neutron-server.upstart.in
+++ b/debian/neutron-server.upstart.in
@@ -15,6 +15,12 @@ script
 	[ -r /usr/share/neutron-common/plugin_guess_func ] || exit 0
 	. /usr/share/neutron-common/plugin_guess_func
 
+	[ -r /etc/default/openstack ] && . /etc/default/openstack
+	[ -r /etc/default/$UPSTART_JOB ] && . /etc/default/$UPSTART_JOB
+
+	[ "x$USE_SYSLOG" = "xyes" ] && DAEMON_ARGS="$DAEMON_ARGS --use-syslog"
+	[ "x$USE_LOGFILE" != "xno" ] && DAEMON_ARGS="$DAEMON_ARGS --log-file=/var/log/neutron/server.log"
+
 	if ! [ -r /etc/neutron/neutron.conf ] ; then
 		echo "Cloud not read /etc/neutron/neutron.conf: exiting"
 		exit 0
@@ -30,5 +36,5 @@ script
         [ -r "$NEUTRON_PLUGIN_CONFIG" ] && CONF_ARG="--config-file $NEUTRON_PLUGIN_CONFIG"
         exec start-stop-daemon --start --chuid neutron:neutron --exec /usr/bin/neutron-server -- \
             --config-file /etc/neutron/neutron.conf \
-            --log-file /var/log/neutron/server.log $CONF_ARG
+            $DAEMON_ARGS $CONF_ARG
 end script
diff --git a/debian/neutron-vpn-agent.init b/debian/neutron-vpn-agent.init
index d0980cb..b4868fb 100644
--- a/debian/neutron-vpn-agent.init
+++ b/debian/neutron-vpn-agent.init
@@ -18,7 +18,7 @@ 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"
+DAEMON_ARGS="--config-file=/etc/neutron/neutron.conf --config-file=/etc/neutron/vpn_agent.ini"
 PIDFILE=/var/run/$NAME.pid
 SCRIPTNAME=/etc/init.d/$NAME
 
@@ -27,6 +27,12 @@ SCRIPTNAME=/etc/init.d/$NAME
 
 . /lib/lsb/init-functions
 
+[ -r /etc/default/openstack ] && . /etc/default/openstack
+[ -r /etc/default/$NAME ] && . /etc/default/$NAME
+
+[ "x$USE_SYSLOG" = "xyes" ] && DAEMON_ARGS="$DAEMON_ARGS --use-syslog"
+[ "x$USE_LOGFILE" != "xno" ] && DAEMON_ARGS="$DAEMON_ARGS --log-file=/var/log/neutron/vpn-agent.log"
+
 do_start()
 {
 	start-stop-daemon --start --quiet --background --chuid neutron:neutron --make-pidfile --pidfile $PIDFILE --startas $DAEMON --test > /dev/null \
diff --git a/debian/neutron-vpn-agent.upstart.in b/debian/neutron-vpn-agent.upstart.in
index 888fa30..35e6b84 100644
--- a/debian/neutron-vpn-agent.upstart.in
+++ b/debian/neutron-vpn-agent.upstart.in
@@ -11,6 +11,14 @@ pre-start script
 	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
+script
+	[ -r /etc/default/openstack ] && . /etc/default/openstack
+	[ -r /etc/default/$UPSTART_JOB ] && . /etc/default/$UPSTART_JOB
+
+	[ "x$USE_SYSLOG" = "xyes" ] && DAEMON_ARGS="$DAEMON_ARGS --use-syslog"
+	[ "x$USE_LOGFILE" != "xno" ] && DAEMON_ARGS="$DAEMON_ARGS --log-file=/var/log/neutron/vpn-agent.log"
+
+	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 \
+	                       $DAEMON_ARGS
+end script



More information about the Openstack-devel mailing list