Bug 1425504 - logrotate keeps ALL the log files
Summary: logrotate keeps ALL the log files
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Gluster Storage
Classification: Red Hat Storage
Component: nfs-ganesha
Version: rhgs-3.1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: RHGS 3.3.0
Assignee: Jiffin
QA Contact: Manisha Saini
URL:
Whiteboard:
Depends On:
Blocks: 1417147
TreeView+ depends on / blocked
 
Reported: 2017-02-21 15:24 UTC by Chris Blum
Modified: 2017-09-21 04:47 UTC (History)
11 users (show)

Fixed In Version: nfs-ganesha-2.4.4-10
Doc Type: Bug Fix
Doc Text:
The logrorate system is missing options in the configuration file which will enable the deletion of ganesha.log and ganesha-gfapi.log. The absence of configuration options results in the log files being rotated but never being deleted or removed, resulting in the consumption of a lot of space. Workaround: Manually delete the log files to recover the space.
Clone Of:
Environment:
Last Closed: 2017-09-21 04:47:57 UTC
Embargoed:


Attachments (Terms of Use)
downstream patch (1.20 KB, patch)
2017-06-16 10:09 UTC, Jiffin
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2017:2779 0 normal SHIPPED_LIVE nfs-ganesha bug fix and enhancement update 2017-09-21 08:17:17 UTC

Description Chris Blum 2017-02-21 15:24:50 UTC
Description of problem:
The supplied logrotate config keeps all the log files forever.
The glusterfs logrotate config will keep the last 52 weeks, which would make sense.

This applies to the ganesha and the ganesha-gfapi log files!

Version-Release number of selected component (if applicable):
glusterfs-ganesha-3.7.9-12.el7rhgs.x86_64

# ganesha.nfsd -v
nfs-ganesha compiled on Jun 7 2016 at 10:54:26
Release = V2.3.1

Steps to Reproduce:
1. Use NFS-ganesha
2. Observe how local storage slowly gets filled up

Actual results:
Log files are rotated but never removed

Expected results:
Log files should be removed "eventually"

Additional info:

# cat /etc/logrotate.d/ganesha
/var/log/ganesha.log {
    copytruncate
    dateext
    compress
)

Comment 6 Jiffin 2017-05-04 06:03:50 UTC
Patch posted upstream for review : https://review.gerrithub.io/#/c/359524/

Comment 8 Manisha Saini 2017-06-15 16:43:34 UTC
Jiffin,

Logrotate is still keeping logs in ganesha.log and ganesha-gfapi.log.Seems the path is wrong in files.(/var/log/ganesha/ganesha.log)

# cat /etc/logrotate.d/ganesha
/var/log/ganesha/ganesha.log {
    weekly
    rotate 52
    copytruncate
    dateext
    compress
    missingok
}


# cat /etc/logrotate.d/ganesha-gfapi 
/var/log/ganesha/ganesha-gfapi.log {
    weekly
    rotate 52
    copytruncate
    dateext
    compress
    missingok
}



=======

# logrotate -vf /etc/logrotate.d/ganesha
reading config file /etc/logrotate.d/ganesha
Allocating hash table for state file, size 15360 B

Handling 1 logs

rotating pattern: /var/log/ganesha/ganesha.log  forced from command line (52 rotations)
empty log files are rotated, old logs are removed
considering log /var/log/ganesha/ganesha.log
error: skipping "/var/log/ganesha/ganesha.log" because parent directory has insecure permissions (It's world writable or writable by group which is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation.
set default create context
======

Comment 9 Manisha Saini 2017-06-16 06:25:25 UTC
Moving it to Assigned state

Comment 10 Jiffin 2017-06-16 10:08:34 UTC
As Manisha pointed out the path in logrotate configuration is wrong. I am attaching patch for that.
For testing the patch, following should be done :
* use logrotate force option to create a logrotated file
logrotate -vf /etc/logrotate.d/ganesha
* Change system date to 1 week ahead and again use logrotate force option to create a file

This will create upto 52 files and from 53rd file onwards , the oldest one will be deleted.

Comment 11 Jiffin 2017-06-16 10:09:58 UTC
Created attachment 1288306 [details]
downstream patch

Comment 12 Manisha Saini 2017-07-03 09:30:31 UTC
Verified this bug on 

# rpm -qa | grep ganesha
nfs-ganesha-debuginfo-2.4.4-10.el7rhgs.x86_64
glusterfs-ganesha-3.8.4-31.el7rhgs.x86_64
nfs-ganesha-2.4.4-10.el7rhgs.x86_64
nfs-ganesha-gluster-2.4.4-10.el7rhgs.x86_64

ganesha.log and ganesha-gfapi.log files gets deleted once it reached the specified days cycles mentioned in /etc/logrotate.d/ganesha and /etc/logrotate.d/ganesha-gfapi

Moving this bug to verified state

Comment 15 errata-xmlrpc 2017-09-21 04:47:57 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2017:2779


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