From 3b846ad235e459481b1bd566a7a697e4ce508a91 Mon Sep 17 00:00:00 2001 From: Lingxian Kong Date: Thu, 30 Sep 2021 22:27:53 +1300 Subject: Fix trove guest agent logrotate * The logrotate file owner should be root * Log file path is /var/log/trove/trove-guestagent.log Change-Id: I669fedc76aa79d7bfc1e4e64684adc4a89a3a15d --- .../install.d/guest-agent-source-install/31-guest-agent-install | 3 ++- .../install.d/guest-agent-source-install/guest-agent.logrotate | 7 +------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/integration/scripts/files/elements/guest-agent/install.d/guest-agent-source-install/31-guest-agent-install b/integration/scripts/files/elements/guest-agent/install.d/guest-agent-source-install/31-guest-agent-install index 0cd63059..cfb6b61e 100755 --- a/integration/scripts/files/elements/guest-agent/install.d/guest-agent-source-install/31-guest-agent-install +++ b/integration/scripts/files/elements/guest-agent/install.d/guest-agent-source-install/31-guest-agent-install @@ -16,7 +16,8 @@ for folder in "/var/lib/trove" "/etc/trove" "/etc/trove/certs" "/etc/trove/conf. chown -R ${GUEST_USERNAME}:root ${folder} done -install -D -g root -o ${GUEST_USERNAME} -m 0644 ${SCRIPTDIR}/guest-agent.logrotate /etc/logrotate.d/guest-agent +# The logrotate file owner should be root or user with uid 0. +install -D -g root -o root -m 0644 ${SCRIPTDIR}/guest-agent.logrotate /etc/logrotate.d/guest-agent # Create a virtual environment (with dependencies installed) for guest agent service /usr/bin/python3 -m venv ${GUEST_VENV} diff --git a/integration/scripts/files/elements/guest-agent/install.d/guest-agent-source-install/guest-agent.logrotate b/integration/scripts/files/elements/guest-agent/install.d/guest-agent-source-install/guest-agent.logrotate index 2a42143a..235b4c48 100644 --- a/integration/scripts/files/elements/guest-agent/install.d/guest-agent-source-install/guest-agent.logrotate +++ b/integration/scripts/files/elements/guest-agent/install.d/guest-agent-source-install/guest-agent.logrotate @@ -1,4 +1,4 @@ -/var/log/guest-agent.log { +/var/log/trove/trove-guestagent.log { daily rotate 10 missingok @@ -6,9 +6,4 @@ compress delaycompress sharedscripts - postrotate - # Signal name shall not have the SIG prefix in kill command - # http://pubs.opengroup.org/onlinepubs/9699919799/utilities/kill.html - kill -s USR1 $(cat /var/run/guest-agent.pid) - endscript } -- cgit v1.2.1