From: Sylvain Baubeau Date: Mon, 7 Apr 2014 15:38:58 +0000 (+0200) Subject: Allow selecting log destination for Neutron daemons X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=30c98fe2c071ac7de697da76dbbb312eaf561f3a;p=openstack-build%2Fneutron-build.git Allow selecting log destination for Neutron daemons --- diff --git a/debian/neutron-dhcp-agent.init b/debian/neutron-dhcp-agent.init index a2d45bd09..45e5dfbae 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 9e5504abd..3170cdf87 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 948f38697..5c7bf0e6d 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 9e10945f4..019c5ae11 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 78b4d9133..0d73a6791 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 21ee48f00..35f1893fd 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 8168e52e4..796549a3b 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 98311453f..1af2195d4 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 120f7ef7d..8fb4653f1 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 f233be996..888a2cfd6 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 44e2eadc4..b720f9ce4 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 2ec450fe5..bd13690a8 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 a86f49889..27c0f79c7 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 f122bd3d6..256e9a5f6 100644 --- a/debian/neutron-plugin-openvswitch-agent.upstart.in +++ b/debian/neutron-plugin-openvswitch-agent.upstart.in @@ -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 diff --git a/debian/neutron-plugin-ryu-agent.upstart.in b/debian/neutron-plugin-ryu-agent.upstart.in index 39e14911f..f7e0b27ac 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.ini \ + $DAEMON_ARGS +end script diff --git a/debian/neutron-server.init b/debian/neutron-server.init index 67d352015..741ca4895 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 5ed83cc2b..ff39720c1 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 d0980cb39..b4868fb81 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 888fa3011..35e6b842d 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