Move log offload files to /var/log/octavia

This patch moves the Octavia Amphora log offload file location, when
using devstack, to /var/log/octavia.
Under Ubuntu it appears that package install order can lead to /var/log
permissions changing to 755 from 775, which causes rsyslog to be unable
to create the log offload files.

Closes-Bug: #2118800

Change-Id: I57ef4833dfd5eab9bc22077d2f213f655687efca
Signed-off-by: Michael Johnson <johnsomor@gmail.com>
This commit is contained in:
Michael Johnson
2025-07-25 21:04:56 +00:00
parent cd4fa250d1
commit d00fcf13b8
3 changed files with 19 additions and 4 deletions

View File

@@ -8,9 +8,9 @@ module(load="imudp")
input(type="imudp" port=["%ADMIN_PORT%", "%TENANT_PORT%"])
if ($inputname == "imudp" and $syslogfacility-text == "local0" and $syslogseverity-text == "info") then {
action(type="omfile" FileCreateMode="0644" File="/var/log/octavia-tenant-traffic.log")&stop
action(type="omfile" FileCreateMode="0644" File="/var/log/octavia/octavia-tenant-traffic.log")&stop
}
if ($inputname == "imudp" and $syslogfacility-text != "local0") then {
action(type="omfile" FileCreateMode="0644" File="/var/log/octavia-amphora.log")&stop
action(type="omfile" FileCreateMode="0644" File="/var/log/octavia/octavia-amphora.log")&stop
}

View File

@@ -621,11 +621,26 @@ function configure_octavia_api_haproxy {
}
function configure_rsyslog {
sudo mkdir -m 775 /var/log/octavia
sudo chgrp syslog /var/log/octavia
sudo cp ${OCTAVIA_DIR}/devstack/etc/rsyslog/10-octavia-log-offloading.conf /etc/rsyslog.d/
sudo sed -e "
s|%ADMIN_PORT%|${OCTAVIA_AMP_LOG_ADMIN_PORT}|g;
s|%TENANT_PORT%|${OCTAVIA_AMP_LOG_TENANT_PORT}|g;
" -i /etc/rsyslog.d/10-octavia-log-offloading.conf
# Temporary backward compatibility symbolic link.
# Remove in the next "I" cycle
sudo touch /var/log/octavia/octavia-tenant-traffic.log
sudo chmod 664 /var/log/octavia/octavia-tenant-traffic.log
sudo chgrp syslog /var/log/octavia/octavia-tenant-traffic.log
sudo ln -s /var/log/octavia/octavia-tenant-traffic.log /var/log/octavia-tenant-traffic.log
sudo touch /var/log/octavia/octavia-amphora.log
sudo chmod 664 /var/log/octavia/octavia-amphora.log
sudo chgrp syslog /var/log/octavia/octavia-amphora.log
sudo ln -s /var/log/octavia/octavia-amphora.log /var/log/octavia-amphora.log
}
function octavia_start {

View File

@@ -74,8 +74,8 @@
tox_envlist: all
zuul_copy_output:
'/var/log/dib-build/': 'logs'
'/var/log/octavia-tenant-traffic.log': 'logs'
'/var/log/octavia-amphora.log': 'logs'
'/var/log/octavia/octavia-tenant-traffic.log': 'logs'
'/var/log/octavia/octavia-amphora.log': 'logs'
- job:
name: octavia-grenade-skip-level