Bug 15713: Restart zebra when rotating logfiles
authorMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
Mon, 1 Feb 2016 12:48:06 +0000 (13:48 +0100)
committerBrendan Gallagher <brendan@bywatersolutions.com>
Wed, 24 Feb 2016 03:41:10 +0000 (03:41 +0000)
commitaf47f00636848e1115b08652abcaec6b789bf672
tree64bd3468c79cf9a11b538a9f4bb99b75b5c08698
parentaf6488b157f85f3f12a84ac70da5524b4b4119b3
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>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
debian/koha-common.logrotate