LogrotatePurgeAfterDays is not recognized in days due to the lack of 'd' suffix

Bug #1836848 reported by Keigo Noha
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
Fix Released
Undecided
Keigo Noha

Bug Description

Description
===========
Change 641608 introduces tmpwatch into logrotate-crond container. However, LogrotatePurgeAfterDays parameter is parsed as hours because there is no suffix to the value.
This triggers an issue that logs are rotated at unintended interval.

Steps to reproduce
==================
1. Deploy overcloud with the current T-H-T.
2. Check /etc/cron.daily/containers-tmpwatch

Expected result
===============
The time value is supplied in days.
~~~
#!/bin/sh
tmpwatch --nodirs \
  -X "/var/log/containers/*/*log" \
  -X "/var/log/containers/*/*/*log" \
  -X "/var/log/containers/*/*err" \
  15 \ <---- HERE
  /var/log/containers/ 2>&1 | logger -t container-tmpwatch
~~~

Actual result
=============
The time value is supplied in hours.
~~~
#!/bin/sh
tmpwatch --nodirs \
  -X "/var/log/containers/*/*log" \
  -X "/var/log/containers/*/*/*log" \
  -X "/var/log/containers/*/*err" \
  15d \ <---- HERE
  /var/log/containers/ 2>&1 | logger -t container-tmpwatch
~~~

Changed in tripleo:
assignee: nobody → Keigo Noha (knoha)
status: New → In Progress
Revision history for this message
Cédric Jeanneret (cjeanner) wrote :

It will need to be backported down to Queens, and down to OSP-13

Thank you for spotting this nasty issue.

tags: added: queens-backport-potential rocky-backport-potential stein-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-heat-templates (master)

Reviewed: https://review.opendev.org/671179
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=a0b9f90a2eefb7d65a72503a0a970451efda1d04
Submitter: Zuul
Branch: master

commit a0b9f90a2eefb7d65a72503a0a970451efda1d04
Author: Keigo Noha <email address hidden>
Date: Wed Jul 17 12:16:57 2019 +0900

    Add a suffix for tmpwatch

    Change 641608 introduces tmpwatch into logrotate-crond container.
    However, LogrotatePurgeAfterDays parameter is parsed in hours because
    there is no suffix to the value. This commit adds a suffix, 'd' to the
    value.

    Closes-Bug: #1836848
    Change-Id: I5e2c92a60f73b75a144228fd13ac31fff990a038

Changed in tripleo:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-heat-templates (stable/stein)

Fix proposed to branch: stable/stein
Review: https://review.opendev.org/671295

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-heat-templates (stable/stein)

Reviewed: https://review.opendev.org/671295
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=76356dc4f2a87cc8035a8b420f7886b5c7b24c82
Submitter: Zuul
Branch: stable/stein

commit 76356dc4f2a87cc8035a8b420f7886b5c7b24c82
Author: Keigo Noha <email address hidden>
Date: Wed Jul 17 12:16:57 2019 +0900

    Add a suffix for tmpwatch

    Change 641608 introduces tmpwatch into logrotate-crond container.
    However, LogrotatePurgeAfterDays parameter is parsed in hours because
    there is no suffix to the value. This commit adds a suffix, 'd' to the
    value.

    Closes-Bug: #1836848
    Change-Id: I5e2c92a60f73b75a144228fd13ac31fff990a038
    (cherry picked from commit a0b9f90a2eefb7d65a72503a0a970451efda1d04)

tags: added: in-stable-stein
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-heat-templates (stable/rocky)

Fix proposed to branch: stable/rocky
Review: https://review.opendev.org/671657

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-heat-templates (stable/queens)

Fix proposed to branch: stable/queens
Review: https://review.opendev.org/671680

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-heat-templates (stable/rocky)

Reviewed: https://review.opendev.org/671657
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=88ec71469795c81689da02c9fd93f2540b9f13c8
Submitter: Zuul
Branch: stable/rocky

commit 88ec71469795c81689da02c9fd93f2540b9f13c8
Author: Keigo Noha <email address hidden>
Date: Wed Jul 17 12:16:57 2019 +0900

    Add a suffix for tmpwatch

    Change 641608 introduces tmpwatch into logrotate-crond container.
    However, LogrotatePurgeAfterDays parameter is parsed in hours because
    there is no suffix to the value. This commit adds a suffix, 'd' to the
    value.

    Closes-Bug: #1836848
    Change-Id: I5e2c92a60f73b75a144228fd13ac31fff990a038
    (cherry picked from commit a0b9f90a2eefb7d65a72503a0a970451efda1d04)
    (cherry picked from commit 76356dc4f2a87cc8035a8b420f7886b5c7b24c82)

tags: added: in-stable-rocky
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-heat-templates (stable/queens)

Reviewed: https://review.opendev.org/671680
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=81e81932c9f000dae14925168c998f09b82f1fbe
Submitter: Zuul
Branch: stable/queens

commit 81e81932c9f000dae14925168c998f09b82f1fbe
Author: Keigo Noha <email address hidden>
Date: Wed Jul 17 12:16:57 2019 +0900

    Add a suffix for tmpwatch

    Change 641608 introduces tmpwatch into logrotate-crond container.
    However, LogrotatePurgeAfterDays parameter is parsed in hours because
    there is no suffix to the value. This commit adds a suffix, 'd' to the
    value.

    Closes-Bug: #1836848
    Change-Id: I5e2c92a60f73b75a144228fd13ac31fff990a038
    (cherry picked from commit a0b9f90a2eefb7d65a72503a0a970451efda1d04)
    (cherry picked from commit 76356dc4f2a87cc8035a8b420f7886b5c7b24c82)
    (cherry picked from commit 88ec71469795c81689da02c9fd93f2540b9f13c8)

tags: added: in-stable-queens
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tripleo-heat-templates 11.1.0

This issue was fixed in the openstack/tripleo-heat-templates 11.1.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tripleo-heat-templates 10.6.1

This issue was fixed in the openstack/tripleo-heat-templates 10.6.1 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tripleo-heat-templates 9.4.1

This issue was fixed in the openstack/tripleo-heat-templates 9.4.1 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tripleo-heat-templates 8.4.1

This issue was fixed in the openstack/tripleo-heat-templates 8.4.1 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.