summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLingxian Kong <anlin.kong@gmail.com>2021-09-30 22:27:53 +1300
committerLingxian Kong <anlin.kong@gmail.com>2021-09-30 20:47:08 +0000
commit3b846ad235e459481b1bd566a7a697e4ce508a91 (patch)
treeddcec5132d47bb438b445b307c2de392bacb8c8c
parentf90594889cca3c670370b4def27a7f67d65daf83 (diff)
downloadtrove-stable/wallaby.tar.gz
Fix trove guest agent logrotatestable/wallaby
* The logrotate file owner should be root * Log file path is /var/log/trove/trove-guestagent.log Change-Id: I669fedc76aa79d7bfc1e4e64684adc4a89a3a15d
-rwxr-xr-xintegration/scripts/files/elements/guest-agent/install.d/guest-agent-source-install/31-guest-agent-install3
-rw-r--r--integration/scripts/files/elements/guest-agent/install.d/guest-agent-source-install/guest-agent.logrotate7
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
}