Bug 1460157 - Gluster client logs not reopened upon rotation on Ubuntu
Summary: Gluster client logs not reopened upon rotation on Ubuntu
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: GlusterFS
Classification: Community
Component: packaging
Version: 3.8
Hardware: Unspecified
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Kaleb KEITHLEY
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-06-09 09:28 UTC by hansmi
Modified: 2017-06-13 15:01 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2017-06-13 15:01:49 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

Description hansmi 2017-06-09 09:28:27 UTC
Description of problem:
The logrotate configuration included with the GlusterFS client packages for Ubuntu doesn't send SIGHUP to the clients as part of its postrotate script:

/var/log/glusterfs/*.log {
…
        rotate 7
…
        postrotate
                [ ! -f /var/run/glusterd.pid ] || kill -HUP `cat /var/run/glusterd.pid`
        endscript
}

Cient logs are written to /var/log/glusterfs/….log. Upon rotation the files are renamed, for example to /var/log/glusterfs/srv-shared-foobar_test-var.log.1. In our case that file was still opened by the client:

$ ls -lh /proc/29872/fd/5
l-wx------ 1 … /proc/29872/fd/5 -> /var/log/glusterfs/srv-shared-foobar_test-var.log.1

After 7 rotations log messages end up being written to a file unreachable via the normal file system (could still be read via /proc/…/fd/…).

The logrotate configuration on CentOS/RHEL looks as follows:
/var/log/glusterfs/*.log {
…
  postrotate
  /usr/bin/killall -HUP glusterfs > /dev/null 2>&1 || true
  /usr/bin/killall -HUP glusterd > /dev/null 2>&1 || true
  endscript
}

Expected behaviour:
Postrotate script sends SIGHUP to Gluster client and client reopens log file.

Reproduced using these package versions:
glusterfs-client 3.8.12-ubuntu1~xenial1
glusterfs-client 3.10.3-ubuntu1~xenial1

Comment 1 Kaleb KEITHLEY 2017-06-13 15:01:49 UTC
All current[1] Debian and Ubuntu packages have been rebuilt using the glusterfs logrotate files.

All Debian and Ubuntu packages going forward will use the glusterfs logrotate files.

Debian packages are on download.gluster.org. Ubuntu packages in the Launchpad PPA. See, e.g., https://download.gluster.org/pub/gluster/glusterfs/LATEST/... README files for more info.


[1] 3.8.12, 3.10.3, 3.11.0.


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