From 5e942154060cf9865639de6b30413667a23c4e68 Mon Sep 17 00:00:00 2001 From: Michal Nasiadka Date: Thu, 2 Jan 2025 10:47:31 +0100 Subject: [PATCH] neutron-dhcp-agent: change dnsmasq.log rights Fixes /var/log/kolla/neutron/dnsmasq.log rights so fluentd can read logs from that file. Closes-Bug: #1693712 Change-Id: I57e36ef07e8840eead2efde77e0ab9dfd4842931 (cherry picked from commit 0f5e39954292a51e7a967d4015a6f024d6ba42f9) --- docker/neutron/neutron-dhcp-agent/Dockerfile.j2 | 2 ++ docker/neutron/neutron-dhcp-agent/extend_start.sh | 9 +++++++++ 2 files changed, 11 insertions(+) create mode 100644 docker/neutron/neutron-dhcp-agent/extend_start.sh diff --git a/docker/neutron/neutron-dhcp-agent/Dockerfile.j2 b/docker/neutron/neutron-dhcp-agent/Dockerfile.j2 index 11bcb432e7..7f54aa1332 100644 --- a/docker/neutron/neutron-dhcp-agent/Dockerfile.j2 +++ b/docker/neutron/neutron-dhcp-agent/Dockerfile.j2 @@ -12,6 +12,8 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build {{ macros.install_packages(neutron_dhcp_agent_packages | customizable("packages")) }} +COPY extend_start.sh /usr/local/bin/kolla_extend_start + {% block neutron_dhcp_agent_footer %}{% endblock %} {% block footer %}{% endblock %} diff --git a/docker/neutron/neutron-dhcp-agent/extend_start.sh b/docker/neutron/neutron-dhcp-agent/extend_start.sh new file mode 100644 index 0000000000..8becf549d9 --- /dev/null +++ b/docker/neutron/neutron-dhcp-agent/extend_start.sh @@ -0,0 +1,9 @@ +if [[ ! -d "/var/log/kolla/neutron" ]]; then + mkdir -p /var/log/kolla/neutron +fi +if [[ ! -f "/var/log/kolla/neutron/dnsmasq.log" ]]; then + touch /var/log/kolla/neutron/dnsmasq.log + chown neutron:kolla /var/log/kolla/neutron/dnsmasq.log +fi + +. /usr/local/bin/kolla_neutron_extend_start