From bd7a51200f3a3c11ca5f18f0b7f95ee9049e1e40 Mon Sep 17 00:00:00 2001 From: Davanum Srinivas Date: Thu, 14 Jan 2016 12:11:23 -0500 Subject: [PATCH] Better location for the nova dhcp logs Use LOGDIR to compute the location of the dhcp logs instead of hardcoding to /opt/stack/logs/ Change-Id: I97ca2d8c8b7901e0895fe89a57675caf8effea53 --- lib/nova | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/nova b/lib/nova index 094eed87ad..62481edfce 100644 --- a/lib/nova +++ b/lib/nova @@ -635,7 +635,19 @@ function create_nova_conf { # Setup logging for nova-dhcpbridge command line sudo cp "$NOVA_CONF" "$NOVA_CONF_DIR/nova-dhcpbridge.conf" - iniset "$NOVA_CONF_DIR/nova-dhcpbridge.conf" DEFAULT log_file "/opt/stack/logs/nova-dhcpbridge.log" + + local service="n-dhcp" + local logfile="${service}.log.${CURRENT_LOG_TIME}" + local real_logfile="${LOGDIR}/${logfile}" + if [[ -n ${LOGDIR} ]]; then + bash -c "cd '$LOGDIR' && ln -sf '$logfile' ${service}.log" + iniset "$NOVA_CONF_DIR/nova-dhcpbridge.conf" DEFAULT log_file "$real_logfile" + if [[ -n ${SCREEN_LOGDIR} ]]; then + # Drop the backward-compat symlink + ln -sf "$real_logfile" ${SCREEN_LOGDIR}/screen-${service}.log + fi + fi + iniset $NOVA_CONF DEFAULT dhcpbridge_flagfile "$NOVA_CONF_DIR/nova-dhcpbridge.conf" }