Both bug 15713 and bug 16138 introduce service restarts when log rotation happens. This is done: - Stop services (plack and zebra) - Rotate the log file - Start services (plack and zebra) This can be avoided by using the 'copytruncate' directive in the logrotate configuration [1] [1] Search for 'copytruncate' here https://linux.die.net/man/8/logrotate
Created attachment 71884 [details] [review] Bug 19610: Make koha-common.logroate 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
Created attachment 71997 [details] [review] Bug 19610: Make koha-common.logroate 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
Hi Hugo, please set your credentials in your development system. Your patch says > Signed-off-by: Your Full Name <your_email> You can find some information here: https://wiki.koha-community.org/wiki/Version_Control_Using_Git#Getting_Started_with_Git
fixed.. thanks!
Created attachment 72040 [details] [review] Bug 19610: Make koha-common.logroate 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>
Created attachment 72042 [details] [review] 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>
Just a not: cp_debian_files.pl does not handle koha-common.logrotate
Pushed to master for 18.05, thanks to everybody involved!