Bug 1460157 - Gluster client logs not reopened upon rotation on Ubuntu
Gluster client logs not reopened upon rotation on Ubuntu
Status: CLOSED CURRENTRELEASE
Product: GlusterFS
Classification: Community
Component: packaging (Show other bugs)
3.8
Unspecified Linux
unspecified Severity unspecified
: ---
: ---
Assigned To: Kaleb KEITHLEY
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-06-09 05:28 EDT by hansmi
Modified: 2017-06-13 11:01 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-06-13 11:01:49 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 hansmi 2017-06-09 05:28:27 EDT
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 11:01:49 EDT
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.