Bug 1261858 - logrotate 'ganesha-gfapi.log'
logrotate 'ganesha-gfapi.log'
Status: CLOSED ERRATA
Product: Red Hat Gluster Storage
Classification: Red Hat
Component: nfs-ganesha (Show other bugs)
3.1
All All
unspecified Severity low
: ---
: RHGS 3.1.3
Assigned To: Jiffin
Shashank Raj
: ZStream
: 1308859 (view as bug list)
Depends On:
Blocks: 1299184 1308859
  Show dependency treegraph
 
Reported: 2015-09-10 06:28 EDT by Soumya Koduri
Modified: 2016-11-07 22:52 EST (History)
11 users (show)

See Also:
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.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-06-23 01:33:04 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Soumya Koduri 2015-09-10 06:28:16 EDT
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 06:39:45 EDT
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 06:44:04 EDT
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 05:12:04 EST
*** Bug 1308859 has been marked as a duplicate of this bug. ***
Comment 6 Niels de Vos 2016-03-29 09:11:31 EDT
(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 02:42:48 EDT
Patch posted in upstream https://review.gerrithub.io/#/c/270854/
Comment 8 Kaleb KEITHLEY 2016-04-13 10:26:51 EDT
fixed in nfs-ganesha-2.3.1-3.el7rhgs and nfs-ganesha-2.3.1-3.el6rhs
Comment 9 Shashank Raj 2016-04-14 05:03:19 EDT
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 08:00:31 EDT
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 02:03:30 EDT
Jiffin,

Could you review and sign-off the edited doc text.
Comment 12 Jiffin 2016-06-15 05:24:36 EDT
Doc test looks good to me
Comment 14 errata-xmlrpc 2016-06-23 01:33:04 EDT
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.