Bug 19610: Make koha-common.logrotate use copytruncate
commitf1c75f7bb54e8bc1a7f4a2aec293a2291dcd27be
authorTomas Cohen Arazi <tomascohen@theke.io>
Sat, 17 Feb 2018 14:57:43 +0000 (17 11:57 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 27 Feb 2018 18:58:33 +0000 (27 15:58 -0300)
tree7f20b6462b133ae3538ff7b22bcdca3d2f56276f
parent0a204a15c4b771bd43460913ee98d6632c17d3b8
Bug 19610: Make koha-common.logrotate use copytruncate

This patch makes logrotate use the **copytruncate** directive, removing
the need to stop the Zebra and Plack servers on log rotation.

To test:
- Run:
  $ misc4dev/cp_debian_files.pl
- Edit the new /etc/logrotate.d/koha-common file changing 'weekly' for
'hourly'. This is to ease testing.
- Run:
  $ sudo ls -l /var/log/koha/kohadev
- Open a second terminal on your kohadevbox. On it...
- Run:
  $ sudo logrotate /etc/logrotate.d/koha-common
- Run:
  $ sudo ls -l /var/log/koha/kohadev
=> SUCCESS: Files got rotated! (i.e. files ending in .1 are created, the
        sizes make sense (.1 have contents, the ones without numbering
            probably zeroed <- it will depend on what's happening with
            your devbox in between).
- Play with your Koha, do some searches too:
=> SUCCESS: You have access to your Koha, searches work. i.e.:
     - Apache handled the log rotation operation
     - Plack handled the log rotation operation
     - Zebra handled the log rotation operation
- Sign off :-D!

Sponsored-by: Orex Digital
Signed-off-by: Hugo Agud hagud@orex.es
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
debian/koha-common.logrotate