Bug 1158923 - glusterfs logrotate config file pollutes global config
Summary: glusterfs logrotate config file pollutes global config
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: GlusterFS
Classification: Community
Component: logging
Version: 3.4.5
Hardware: Unspecified
OS: Unspecified
medium
high
Target Milestone: ---
Assignee: bugs@gluster.org
QA Contact:
URL:
Whiteboard:
Depends On: 1126802
Blocks: glusterfs-3.4.6 1126801 1158456
TreeView+ depends on / blocked
 
Reported: 2014-10-30 14:06 UTC by Kaleb KEITHLEY
Modified: 2015-12-01 16:45 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 1126802
Environment:
Last Closed: 2015-04-13 06:50:22 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

Description Kaleb KEITHLEY 2014-10-30 14:06:38 UTC
+++ This bug was initially created as a clone of Bug #1126802 +++

+++ This bug was initially created as a clone of Bug #1126801 +++
+++                                                           +++
+++ This bug is for the master branch                         +++
+++                                                           +++

Description of problem:

Glusterfs's logrotate config file in the /etc/logrotate.d directory pollutes logrotate's global config file at /etc/logrotate.conf.  Namely, the file /etc/logrotate.d/glusterfs-georep has global directives in the beginning of the file that reads

"""

rotate 52
missingok

compress
delaycompress
notifempty

"""

When this file is included into logrotate's config file (line 18 of /etc/logrotate.conf, which reads "include /etc/logrotate.d"), it is splashed into the state of logrotate's config reader, "as if it was included inline" (man logrotate).  Therefore, those lines will override whatever corresponding configuration terms already present in /etc/logrotate.conf.

Especially, the "rotate 52" directive will delay the removal of old logs up to a year globally (!!), resulting in a large number of old logs that should have been deleted.

Please move the above directives inside the curly braces so they don't pollute the global config state.


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

glusterfs-3.5.2-1.fc20


How reproducible:

Very.


Steps to Reproduce:

1.  Install glusterfs.
2.  Watch old logs grow;  output of logrotate -d /etc/logrotate.conf showing "52 rotations" not just for glusterfs georeplication logs but almost all other logs.


Actual results:

Many old logs are not removed.  logrotate -d /etc/logrotate.conf output shows "52 rotations" for all logs processed after glusterfs-georep that don't override the "rotate" directive individually.


Expected results:

Should not have interfered with other logs.


Additional info:

The spurious old logs caused by this still needs manual removal after the fix, because logrotate, given "rotate 4" directive, won't even touch beyond the 5th log file.

--- Additional comment from Niels de Vos on 2014-10-27 06:15:20 EDT ---



--- Additional comment from Anand Avati on 2014-10-28 15:18:19 EDT ---

REVIEW: http://review.gluster.org/8994 (logrotate: gluster logrotate config should not be global) posted (#1) for review on master by Lalatendu Mohanty (lmohanty)

--- Additional comment from Anand Avati on 2014-10-29 13:40:36 EDT ---

COMMIT: http://review.gluster.org/8994 committed in master by Vijay Bellur (vbellur) 
------
commit a5d73daabf6df95bc73b186d92f3e2d1239a6f8a
Author: Lalatendu Mohanty <lmohanty>
Date:   Wed Oct 29 00:44:33 2014 +0530

    logrotate: gluster logrotate config should not be global
    
    Issue : Previously glusterfs logrotate config file pollutes
    global config. So moved the directives inside the curly braces,
     so they don't pollute the global config state.
    
    Change-Id: I8836893dfcdf457d9c5d766612d687bfce64e2ae
    BUG: 1126802
    Signed-off-by: Lalatendu Mohanty <lmohanty>
    Reviewed-on: http://review.gluster.org/8994
    Reviewed-by: Niels de Vos <ndevos>
    Tested-by: Gluster Build System <jenkins.com>

Comment 1 Anand Avati 2014-10-30 14:16:10 UTC
REVIEW: http://review.gluster.org/9013 (logrotate: gluster logrotate config should not be global) posted (#1) for review on release-3.4 by Kaleb KEITHLEY (kkeithle)

Comment 2 Anand Avati 2014-10-30 15:31:47 UTC
COMMIT: http://review.gluster.org/9013 committed in release-3.4 by Kaleb KEITHLEY (kkeithle) 
------
commit 049580f209a1f2bed538d8c3f6953e3789d616f7
Author: Kaleb S. KEITHLEY <kkeithle>
Date:   Thu Oct 30 10:13:36 2014 -0400

    logrotate: gluster logrotate config should not be global
    
    Issue : Previously glusterfs logrotate config file pollutes
    global config. So moved the directives inside the curly braces,
    so they don't pollute the global config state.
    
    Backport of fix from BZ 1126801, http://review.gluster.org/#/c/9001/
    
    Change-Id: Iafaa6bb295b7dd7554c2654716cc9aeafd6d7a68
    BUG: 1158923
    Signed-off-by: Kaleb S. KEITHLEY <kkeithle>
    Reviewed-on: http://review.gluster.org/9013
    Reviewed-by: Humble Devassy Chirammal <humble.devassy>
    Tested-by: Gluster Build System <jenkins.com>
    Reviewed-by: Lalatendu Mohanty <lmohanty>
    Reviewed-by: Justin Clift <justin>


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