RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1266214 - /etc/logrotate.d/glusterfs improperly modifies global logrotate settings
Summary: /etc/logrotate.d/glusterfs improperly modifies global logrotate settings
Keywords:
Status: CLOSED DUPLICATE of bug 1172542
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: glusterfs
Version: 7.2
Hardware: Unspecified
OS: Unspecified
urgent
urgent
Target Milestone: rc
: ---
Assignee: Bala.FA
QA Contact: Sudhir D
URL:
Whiteboard:
Depends On: 1171865 1266210
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-09-24 19:23 UTC by Ryan Sawhill
Modified: 2017-03-25 15:40 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 1266210
Environment:
Last Closed: 2015-09-24 19:57:02 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1292406 1 None None None 2021-01-20 06:05:38 UTC

Internal Links: 1292406

Description Ryan Sawhill 2015-09-24 19:23:37 UTC
+++ This bug was initially created as a clone of Bug #1266210 +++

Description of problem:

glusterfs provides /etc/logrotate.d/glusterfs which configures logrotate to rotate /var/log/glusterfs/*.log and /var/log/glusterfs/bricks/*.log files.

Unfortunately it has six directives which are improperly unbounded by brackets.

  [rsaw logrotate.d]$ cat glusterfs
  # perform the log rotate every week
  weekly
  # keep the backup of 52 weeks
  rotate 52
  missingok

  # compress the logs, but from the .2 onwards
  compress
  delaycompress
  notifempty

  # Rotate client logs
  /var/log/glusterfs/*.log {
    sharedscripts
    postrotate
    /usr/bin/killall -HUP glusterfs > /dev/null 2>&1 || true
    /usr/bin/killall -HUP glusterd > /dev/null 2>&1 || true
    endscript
  }

  # Rotate server logs
  /var/log/glusterfs/bricks/*.log {
    sharedscripts
    postrotate
    /usr/bin/killall -HUP glusterfsd > /dev/null 2>&1 || true
    endscript
  }

To be clear, the above modifies the global logrotate config, MAKING IT SO THAT ALL OTHER LOG FILES ON THE SYSTEM will be rotated weekly, compressed, and kept for 52 weeks.


Version-Release number of selected component (if applicable):

I checked the latest version available in standard repos: glusterfs-3.6.0.29-2.el7


How reproducible:

100%


Steps to Reproduce:

1. Install glusterfs package
2. Open /etc/logrotate.d/glusterfs
3. Ponder.


Expected results:

The file could instead look like this.

  # Rotate client & server logs
  /var/log/glusterfs/*.log
  /var/log/glusterfs/bricks/*.log
  {
    # perform the log rotate every week
    weekly
    # keep the backup of 52 weeks
    rotate 52
    missingok
    # compress the logs, but from the .2 onwards
    compress
    delaycompress
    notifempty
    sharedscripts
    postrotate
    /usr/bin/killall -HUP glusterfs > /dev/null 2>&1 || true
    /usr/bin/killall -HUP glusterd > /dev/null 2>&1 || true
    /usr/bin/killall -HUP glusterfsd > /dev/null 2>&1 || true
    endscript
  }


Additional info:

I noticed this by looking at an strace of logrotate and seeing "(52 rotations)" for EVERY pattern. E.g.,

  write(2, "\nrotating pattern: /var/log/cron\n/var/log/maillog\n/var/log/messages\n/var/log/secure\n/var/log/spooler\n ", 102)
  write(2, "weekly ", 7)
  write(2, "(52 rotations)\n", 15)

Of course the above was on a system where the above pattern of files was managed by /etc/logrotate.d/syslog which had no customizations and thus that "52" there should have instead said "7" since /etc/logrotate.conf was also default.

Comment 1 Ryan Sawhill 2015-09-24 19:57:02 UTC

*** This bug has been marked as a duplicate of bug 1172542 ***


Note You need to log in before you can comment on or make changes to this bug.