gluster / gluster-block

A framework for gluster block storage
GNU General Public License v2.0
74 stars 32 forks source link

logrotate: rename logrotate config file #231

Closed pkalever closed 5 years ago

pkalever commented 5 years ago

What does this PR achieve? Why do we need it?

Problem:

Build was failing with: [root@localhost x86_64]# rpmlint gluster-block-0.4-1.x86_64.rpm gluster-block.x86_64: E: incoherent-logrotate-file /etc/logrotate.d/gluster-blockd 1 packages and 0 specfiles checked; 1 errors.

Solution:

incoherent-logrotate-file ?

Solution:- The log file or directory name should be the same as the package name in lower case.

Hence renaming the logrotate filename back to gluster-block

Signed-off-by: Prasanna Kumar Kalever prasanna.kalever@redhat.com

lxbsz commented 5 years ago

Test result:

[root@localhost]# cat /etc/logrotate.d/gluster-block 
# Rotate all the gluster-block logs
/var/log/gluster-block/*.log {
  sharedscripts
  weekly
  maxsize 10M
  minsize 100k

# 6 months of logs are good enough
  rotate 26

  missingok
  compress
  delaycompress
  notifempty
  postrotate
  killall -q -s 1 gluster-blockd > /dev/null 2>&1 || true
  endscript
}
[root@localhost]# vim /etc/sysconfig/gluster-blockd 
[root@localhost]# grep GB_LOG_DIR /etc/sysconfig/gluster-blockd 
GB_LOG_DIR="/var/log/gluster-block/dd"
[root@rhel3 gluster-block]# cat /etc/logrotate.d/gluster-block 
# Rotate all the gluster-block logs
/var/log/gluster-block/dd/*.log {
  sharedscripts
  weekly
  maxsize 10M
  minsize 100k

# 6 months of logs are good enough
  rotate 26

  missingok
  compress
  delaycompress
  notifempty
  postrotate
  killall -q -s 1 gluster-blockd > /dev/null 2>&1 || true
  endscript
}
pkalever commented 5 years ago

Merged this PR through command line interface. Closing this now. Thanks a lot @lxbsz .