Bug 15713 - Restart zebra when rotating logfiles
Summary: Restart zebra when rotating logfiles
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Packaging (show other bugs)
Version: Main
Hardware: All All
: P5 - low major
Assignee: Marcel de Rooy
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-01 12:45 UTC by Marcel de Rooy
Modified: 2019-06-27 09:24 UTC (History)
7 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 15713: Restart zebra when rotating logfiles (1.85 KB, patch)
2016-02-01 13:25 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 15713: Restart zebra when rotating logfiles (1.94 KB, patch)
2016-02-02 09:12 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 15713: Restart zebra when rotating logfiles (2.01 KB, patch)
2016-02-02 11:49 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Marcel de Rooy 2016-02-01 12:45:26 UTC

    
Comment 1 Marcel de Rooy 2016-02-01 13:25:18 UTC Comment hidden (obsolete)
Comment 2 David Cook 2016-02-02 04:03:23 UTC
Looks good at a glance.
Comment 3 Marc Véron 2016-02-02 09:12:01 UTC Comment hidden (obsolete)
Comment 4 Jonathan Druart 2016-02-02 11:49:12 UTC
Created attachment 47548 [details] [review]
Bug 15713: Restart zebra when rotating logfiles

Somehow, it may happen that Zebra keeps writing to the old rotated logfile
with extension .log.1. I must add that although I saw that happen (a new
log was created and was empty, while Zebra kept writing to log.1 for weeks),
I cannot reproduce it every time.

By stopping the zebra server in prerotate and starting it again in
postrotate, this should not happen at all. In practice, this implies that
your Zebra server is restarted once a week.

Note: The existing sharedscripts directive makes sure that these actions
are not executed for all individual logfiles but once for all matching
logfiles (even when running multiple instances).

Test plan:
[1] Apply the change in koha-common.logrotate to the file
    /etc/logrotate.d/koha-common.
[2] Run logrotate -f /etc/logrotate.conf (forcing a logrotate).
[3] Check in zebra-error.log that your zebra server was stopped
    ('killed by signal 15').
[4] Verify that your Zebra server runs (read: has been restarted).
    (Do a search..)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 5 Brendan Gallagher 2016-02-24 03:54:22 UTC
Pushed to Master - Should be in the May 2016 release.  Thanks!
Comment 6 Julian Maurice 2016-04-01 13:06:39 UTC
Patch pushed to 3.22.x, will be in 3.22.6
Comment 7 Frédéric Demians 2016-04-27 15:42:54 UTC
Pushed to 3.20.x, will be in 3.20.11.