]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Allow selecting log destination for Neutron daemons
authorSylvain Baubeau <sylvain.baubeau@enovance.com>
Mon, 7 Apr 2014 15:38:58 +0000 (17:38 +0200)
committerThomas Goirand <thomas@goirand.fr>
Fri, 11 Apr 2014 06:06:11 +0000 (14:06 +0800)
19 files changed:
debian/neutron-dhcp-agent.init
debian/neutron-dhcp-agent.upstart.in
debian/neutron-l3-agent.init
debian/neutron-l3-agent.upstart.in
debian/neutron-lbaas-agent.init
debian/neutron-lbaas-agent.upstart.in
debian/neutron-metadata-agent.init
debian/neutron-metadata-agent.upstart.in
debian/neutron-metering-agent.init
debian/neutron-metering-agent.upstart.in
debian/neutron-plugin-linuxbridge-agent.upstart.in
debian/neutron-plugin-nec-agent.upstart.in
debian/neutron-plugin-openvswitch-agent.init
debian/neutron-plugin-openvswitch-agent.upstart.in
debian/neutron-plugin-ryu-agent.upstart.in
debian/neutron-server.init
debian/neutron-server.upstart.in
debian/neutron-vpn-agent.init
debian/neutron-vpn-agent.upstart.in

index a2d45bd09339f591fd3e311b2cb08d5d60f423c2..45e5dfbae2eba15e41a0f32ae2f02e421159f6ff 100644 (file)
@@ -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 \
index 9e5504abdbdf489d111b5a664a681709ef225288..3170cdf87e31e6451e3e04cc3fe79c0758894dbb 100644 (file)
@@ -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
index 948f386978e05e4359f278c22ef1da8464355391..5c7bf0e6d08366462746b8fb935f00a1f8de95c8 100644 (file)
@@ -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 \
index 9e10945f43f2260c4d7f005d7d7bc9e4ed4965ea..019c5ae11c9ef1de35c5da8ddf9de3e960d40a66 100644 (file)
@@ -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
index 78b4d9133125d08053671ca2b6f5dc3313d0002f..0d73a6791c991f3ca09023f05a7cc5f44323d1a3 100644 (file)
@@ -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 \
index 21ee48f000da3b7aa01f3ae4afe779bd8e239ad3..35f1893fd023eabeb1280539e172bfb9d83d83d2 100644 (file)
@@ -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
index 8168e52e4bc6db1624faa3ed0970492b6b92d096..796549a3b4d7736d860392e2c899642837178f06 100644 (file)
@@ -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 \
index 98311453f74aa800f1b37b35949ac31b2361006a..1af2195d46586ce2880c05c82d5429a6c4e20f81 100644 (file)
@@ -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
index 120f7ef7d20ccb5db5a335e0062d5e6f752c4961..8fb4653f14c7d91bc95eb6493961747dafbdb113 100644 (file)
@@ -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 \
index f233be9968cfa9d9e513754d3458e680b9b48657..888a2cfd6e9be8ac199599fa1476bd7ed80e94c6 100644 (file)
@@ -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
index 44e2eadc4368963b35d214f95d3fbb8ba5046fdf..b720f9ce49b561f518176eb9a1687f3aa432345b 100644 (file)
@@ -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
index 2ec450fe58b38e229de9c34aad39837a9be55238..bd13690a8d9de3a3c5d7f5cdfe8080d310f2ff55 100644 (file)
@@ -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
index a86f49889490f971bbca2aeec2f14bea4fb4c054..27c0f79c7bc0abb79a06f1c38a92afb431736aa2 100644 (file)
@@ -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
index f122bd3d6efe8044d6ec28188a893db2b528e788..256e9a5f6097f2e254f3387f98df2dc0c2a216e2 100644 (file)
@@ -28,7 +28,12 @@ script
        neutron_core_plugin_to_plugin_name ${CURRENT_PLUGIN}
        neutron_plugin_ini_path ${NEUTRON_PLUGIN_NAME}
        [ -r "$NEUTRON_PLUGIN_CONFIG" ] && CONF_ARG="--config-file $NEUTRON_PLUGIN_CONFIG"
+       [ -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 \
-               --log-file=/var/log/neutron/ovs-agent.log $CONF_ARG
+               $CONF_ARG $DAEMON_ARGS
 end script
index 39e14911f33901aca99d063d1faaa02c20f10c0e..f7e0b27ac7e851149f0be4d2a51e6f99e921792b 100644 (file)
@@ -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.ini \
+                              $DAEMON_ARGS
+end script
index 67d35201525622e2cf4368f678b90c15169f09cd..741ca489517b5ad6185d237756c294b5f36922a0 100644 (file)
@@ -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
 
index 5ed83cc2b1b6f44f7f869c365a297ef970d2231d..ff39720c1905b7cbcc56e6ac3e6bc8771462c614 100644 (file)
@@ -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
index d0980cb39704ff36b3c81808fd205e085ae9fae3..b4868fb81c138aaf5f78df01f080c67b29eb3722 100644 (file)
@@ -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 \
index 888fa30110a29675c86dd547b1762c7578591c20..35e6b842dce0c09d028b48f34897b0c4c0635449 100644 (file)
@@ -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