Bug 1261858 - logrotate 'ganesha-gfapi.log'
Summary: logrotate 'ganesha-gfapi.log'
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Gluster Storage
Classification: Red Hat Storage
Component: nfs-ganesha
Version: rhgs-3.1
Hardware: All
OS: All
unspecified
low
Target Milestone: ---
: RHGS 3.1.3
Assignee: Jiffin
QA Contact: Shashank Raj
URL:
Whiteboard:
: 1308859 (view as bug list)
Depends On:
Blocks: 1299184 1308859
TreeView+ depends on / blocked
 
Reported: 2015-09-10 10:28 UTC by Soumya Koduri
Modified: 2019-09-12 08:53 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Previously, the log rotate configuration was no defined for ganesha-gfapi.log file. As a consequence, the ganesha-gfapi.log file was not log rotated and consumed lots of space. With this fix, appropriate configuration file was created and now the ganesha-gfapi.log file is rotated properly.
Clone Of:
Environment:
Last Closed: 2016-06-23 05:33:04 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2016:1247 0 normal SHIPPED_LIVE nfs-ganesha update for Red Hat Gluster Storage 3.1 update 3 2016-06-23 09:12:43 UTC

Description Soumya Koduri 2015-09-10 10:28:16 UTC
Description of problem:

The ganesha-gfapi.log generated by nfs-ganesha service could grow to a very large size. It may be better to rotate this log file.

Maybe while packaging downstream rpms, we could edit "src/config_samples/logrotate_ganesha" and add an entry for '/var/log/ganesha-gfapi.log' as well.

Comment 2 Niels de Vos 2015-09-10 10:39:45 UTC
This should not only be done downstream, the upstream FSAL_GLUSTER also writes to /var/log/ganesha-gfapi.log by default.

Comment 3 Soumya Koduri 2015-09-10 10:44:04 UTC
That's right. I am not sure how we can include FSAL_GLUSTER specific log changes without editing "src/nfs-ganesha.spec-in.cmake" or "src/config_samples/logrotate_ganesha" and if its acceptable upstream.

Comment 4 Jiffin 2016-02-16 10:12:04 UTC
*** Bug 1308859 has been marked as a duplicate of this bug. ***

Comment 6 Niels de Vos 2016-03-29 13:11:31 UTC
(In reply to Soumya Koduri from comment #3)
> That's right. I am not sure how we can include FSAL_GLUSTER specific log
> changes without editing "src/nfs-ganesha.spec-in.cmake" or
> "src/config_samples/logrotate_ganesha" and if its acceptable upstream.

I suggest that we add a new configuration file for this in upstream, something like src/config_samples/logrotate_fsal_gluster:

  /var/log/ganesha-gfapi.log {
      copytruncate
      dateext
      compress
  }

This file can then be installed only when FSAL_GLUSTER is enabled, and included in the nfs-ganesha-gluster sub-package.

Comment 7 Jiffin 2016-03-30 06:42:48 UTC
Patch posted in upstream https://review.gerrithub.io/#/c/270854/

Comment 8 Kaleb KEITHLEY 2016-04-13 14:26:51 UTC
fixed in nfs-ganesha-2.3.1-3.el7rhgs and nfs-ganesha-2.3.1-3.el6rhs

Comment 9 Shashank Raj 2016-04-14 09:03:19 UTC
Verified this bug on RHEL 7 platfrom and it works fine as below:

[root@dhcp37-180 ~]# ls -ltr /etc/logrotate.d/ | grep ganesha
-rw-r--r--. 1 root root   73 Apr 13 19:37 ganesha-gfapi
-rw-r--r--. 1 root root   67 Apr 13 19:37 ganesha

[root@dhcp37-180 ~]# ls -ltr /var/log/ | grep ganesha
-rw-r--r--. 1 root      root           3035 Apr 12 04:20 ganesha.log-20160412.gz
-rw-------. 1 root      root     4615688831 Apr 14 00:47 ganesha-gfapi.log
-rw-r--r--. 1 root      root          33139 Apr 14 00:47 ganesha.log

[root@dhcp37-180 log]# logrotate -fv /etc/logrotate.d/ganesha-gfapi 
reading config file /etc/logrotate.d/ganesha-gfapi

Handling 1 logs

rotating pattern: /var/log/ganesha-gfapi.log  forced from command line (no old logs will be kept)
empty log files are rotated, old logs are removed
considering log /var/log/ganesha-gfapi.log
  log needs rotating
rotating log /var/log/ganesha-gfapi.log, log->rotateCount is 0
dateext suffix '-20160414'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
glob finding old rotated logs failed
copying /var/log/ganesha-gfapi.log to /var/log/ganesha-gfapi.log-20160414
set default create context
truncating /var/log/ganesha-gfapi.log
compressing log with: /bin/gzip
set default create context

[root@dhcp37-180 log]# ls -ltr /var/log/ | grep ganesha
-rw-r--r--. 1 root      root          3035 Apr 12 04:20 ganesha.log-20160412.gz
-rw-------. 1 root      root      61292239 Apr 14 00:47 ganesha-gfapi.log-20160414.gz
-rw-r--r--. 1 root      root         33139 Apr 14 00:47 ganesha.log
-rw-------. 1 root      root             0 Apr 14 02:16 ganesha-gfapi.log

On RHEL 6

Beacuse of the bug (https://bugzilla.redhat.com/show_bug.cgi?id=1327074), could not proceed with the verification on RHEL 6.

Once we get a new build with working fix, will verify this on RHEL 6 as well.

Comment 10 Shashank Raj 2016-04-22 12:00:31 UTC
Verified this bug on RHEL 6 platform with latest glusterfs and ganesha build:

[root@dhcp42-121 ~]# rpm -qa|grep glusterfs
glusterfs-api-3.7.9-2.el6rhs.x86_64
glusterfs-geo-replication-3.7.9-2.el6rhs.x86_64
glusterfs-libs-3.7.9-2.el6rhs.x86_64
glusterfs-client-xlators-3.7.9-2.el6rhs.x86_64
glusterfs-fuse-3.7.9-2.el6rhs.x86_64
glusterfs-server-3.7.9-2.el6rhs.x86_64
glusterfs-ganesha-3.7.9-2.el6rhs.x86_64
glusterfs-3.7.9-2.el6rhs.x86_64
glusterfs-cli-3.7.9-2.el6rhs.x86_64

[root@dhcp42-121 ~]# rpm -qa|grep ganesha
nfs-ganesha-gluster-2.3.1-4.el6rhs.x86_64
glusterfs-ganesha-3.7.9-2.el6rhs.x86_64
nfs-ganesha-2.3.1-4.el6rhs.x86_64

Steps followed are as below:

[root@dhcp42-121 bin]# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 6.8 (Santiago)

[root@dhcp42-121 bin]# ls -ltr /etc/logrotate.d/ | grep ganesha
-rw-r--r--. 1 root root   73 Apr 21 08:00 ganesha-gfapi
-rw-r--r--. 1 root root   67 Apr 21 08:00 ganesha

[root@dhcp42-121 bin]# ls -ltr /var/log/ | grep ganesha
-rw-r--r--. 1 root      root       4390 Apr 22 22:51 ganesha.log
-rw-------. 1 root      root      14840 Apr 22 22:51 ganesha-gfapi.log

[root@dhcp42-121 bin]# logrotate -fv /etc/logrotate.d/ganesha-gfapi
reading config file /etc/logrotate.d/ganesha-gfapi
reading config info for /var/log/ganesha-gfapi.log 

Handling 1 logs

rotating pattern: /var/log/ganesha-gfapi.log  forced from command line (no old logs will be kept)
empty log files are rotated, old logs are removed
considering log /var/log/ganesha-gfapi.log
  log needs rotating
rotating log /var/log/ganesha-gfapi.log, log->rotateCount is 0
dateext suffix '-20160422'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
glob finding old rotated logs failed
copying /var/log/ganesha-gfapi.log to /var/log/ganesha-gfapi.log-20160422
set default create context
truncating /var/log/ganesha-gfapi.log
compressing log with: /bin/gzip
set default create context
[root@dhcp42-121 bin]# ls -ltr /var/log/ | grep ganesha
-rw-r--r--. 1 root      root       4390 Apr 22 22:51 ganesha.log
-rw-------. 1 root      root          0 Apr 22 22:52 ganesha-gfapi.log
-rw-------. 1 root      root       1674 Apr 22 22:52 ganesha-gfapi.log-20160422.gz

Its working as expected. Hence based on the above observation, marking this bug as Verified.

Comment 11 Divya 2016-06-10 06:03:30 UTC
Jiffin,

Could you review and sign-off the edited doc text.

Comment 12 Jiffin 2016-06-15 09:24:36 UTC
Doc test looks good to me

Comment 14 errata-xmlrpc 2016-06-23 05:33:04 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-2016:1247


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