From 037440034b631c0d30d4a92a2150e6cf78df3a5d Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Tue, 18 Feb 2020 20:34:13 -0800 Subject: [PATCH] Move collectd logs to platformdata and rotate it --- CHANGES | 1 + setup/start.sh | 5 +++-- setup/start/collectd/collectd.conf | 2 +- setup/start/logrotate/platform | 1 + 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 5e71740e0..7db0eeef6 100644 --- a/CHANGES +++ b/CHANGES @@ -1785,4 +1785,5 @@ * Display timestamps in browser timezone in the UI * Mail eventlog * Add permission where a user can just invite other users +* Setup logrotate configs for collectd since upstream does not set it up diff --git a/setup/start.sh b/setup/start.sh index fccf0b506..caab37d95 100755 --- a/setup/start.sh +++ b/setup/start.sh @@ -47,7 +47,8 @@ mkdir -p "${PLATFORM_DATA_DIR}/backup" mkdir -p "${PLATFORM_DATA_DIR}/logs/backup" \ "${PLATFORM_DATA_DIR}/logs/updater" \ "${PLATFORM_DATA_DIR}/logs/tasks" \ - "${PLATFORM_DATA_DIR}/logs/crash" + "${PLATFORM_DATA_DIR}/logs/crash" \ + "${PLATFORM_DATA_DIR}/logs/collectd" mkdir -p "${PLATFORM_DATA_DIR}/update" mkdir -p "${BOX_DATA_DIR}/appicons" @@ -114,7 +115,7 @@ rm -f /etc/sudoers.d/${USER} cp "${script_dir}/start/sudoers" /etc/sudoers.d/${USER} echo "==> Configuring collectd" -rm -rf /etc/collectd +rm -rf /etc/collectd /var/log/collectd.log ln -sfF "${PLATFORM_DATA_DIR}/collectd" /etc/collectd cp "${script_dir}/start/collectd/collectd.conf" "${PLATFORM_DATA_DIR}/collectd/collectd.conf" systemctl restart collectd diff --git a/setup/start/collectd/collectd.conf b/setup/start/collectd/collectd.conf index 75d559f8b..11d9cc1db 100644 --- a/setup/start/collectd/collectd.conf +++ b/setup/start/collectd/collectd.conf @@ -57,7 +57,7 @@ LoadPlugin logfile LogLevel "info" - File "/var/log/collectd.log" + File "/home/yellowtent/platformdata/logs/collectd/collectd.log" Timestamp true PrintSeverity false diff --git a/setup/start/logrotate/platform b/setup/start/logrotate/platform index 0fef1911c..650300514 100644 --- a/setup/start/logrotate/platform +++ b/setup/start/logrotate/platform @@ -9,6 +9,7 @@ /home/yellowtent/platformdata/logs/sftp/*.log /home/yellowtent/platformdata/logs/redis-*/*.log /home/yellowtent/platformdata/logs/crash/*.log +/home/yellowtent/platformdata/logs/collectd/*.log /home/yellowtent/platformdata/logs/updater/*.log { # only keep one rotated file, we currently do not send that over the api rotate 1