From 63f12683e49ad313d7ce17ad6f3788b76e35c58a Mon Sep 17 00:00:00 2001 From: GowthamShanmugasundaram Date: Fri, 18 Jan 2019 15:38:17 +0000 Subject: [PATCH] Logrotate for tendrl-api log files bugzilla: 1654183 tendrl-bug-id: Tendrl/api#455 Signed-off-by: GowthamShanmugasundaram --- config/tendrl-api_logrotate.conf | 10 ++++++++++ tendrl-api.spec | 5 +++++ 2 files changed, 15 insertions(+) create mode 100644 config/tendrl-api_logrotate.conf diff --git a/config/tendrl-api_logrotate.conf b/config/tendrl-api_logrotate.conf new file mode 100644 index 0000000..b6cf685 --- /dev/null +++ b/config/tendrl-api_logrotate.conf @@ -0,0 +1,10 @@ +/var/log/tendrl/api/*.log +{ + su tendrl-api tendrl-api + size=100M + rotate 10 + missingok + compress + notifempty + create 0664 tendrl-api tendrl-api +} diff --git a/tendrl-api.spec b/tendrl-api.spec index 3a7d5a5..5f10c31 100644 --- a/tendrl-api.spec +++ b/tendrl-api.spec @@ -89,6 +89,7 @@ install -Dm 0644 config/apache.vhost.sample $RPM_BUILD_ROOT%{_sysconfdir}/httpd/ install -Dm 0644 config/puma/*.rb $RPM_BUILD_ROOT%{install_dir}/config/puma/ install -Dm 0644 config/initializers/*.rb $RPM_BUILD_ROOT%{install_dir}/config/initializers/ install -Dm 0644 firewalld/tendrl-api.xml $RPM_BUILD_ROOT%{_prefix}/lib/firewalld/services/tendrl-api.xml +install -Dm 0644 config/tendrl-api_logrotate.conf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/tendrl-api_logrotate.conf # Symlink writable directories onto /var ln -s %{log_dir} $RPM_BUILD_ROOT%{install_dir}/log @@ -121,6 +122,7 @@ systemctl enable tendrl-api >/dev/null 2>&1 || : %{install_dir}/ %{doc_dir}/ %{_unitdir}/tendrl-api.service +%{_sysconfdir}/logrotate.d/tendrl-api_logrotate.conf %config(noreplace) %attr(0640, root, %{app_group}) %{config_file} %config(noreplace) %{_prefix}/lib/firewalld/services/tendrl-api.xml @@ -129,6 +131,9 @@ systemctl enable tendrl-api >/dev/null 2>&1 || : %config(noreplace) %{_sysconfdir}/httpd/conf.d/tendrl.conf %changelog +* Fri Jan 18 2019 Gowtham Shanmugasundaram - 1.6.3-8 +- Log rotation for tendrl log files + * Fri Jul 27 2018 Shirshendu Mukherjee - 1.6.3-7 - Bugfix for recursion when non-json 'data' attr is present