Commit f660b034 authored by Thomas Gambier's avatar Thomas Gambier 🚴🏼

stack/logrotate: Use xz for log compression.

Use xz instead of gzip.
Also put the cron script in etc/service instead of etc/run (to have the
"cron-on-watch" process)
parent c465ef49
...@@ -72,7 +72,7 @@ class ServicesTestCase(InstanceTestCase): ...@@ -72,7 +72,7 @@ class ServicesTestCase(InstanceTestCase):
] ]
expected_process_names = [ expected_process_names = [
'monitor-httpd-{hash}-on-watch', 'monitor-httpd-{hash}-on-watch',
'crond-{hash}', 'crond-{hash}-on-watch',
] ]
supervisor = self.getSupervisorRPCServer().supervisor supervisor = self.getSupervisorRPCServer().supervisor
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
extends = extends =
buildout.hash.cfg buildout.hash.cfg
../../component/dcron/buildout.cfg ../../component/dcron/buildout.cfg
../../component/gzip/buildout.cfg ../../component/xz-utils/buildout.cfg
../../component/logrotate/buildout.cfg ../../component/logrotate/buildout.cfg
parts = parts =
template-logrotate-base template-logrotate-base
...@@ -25,7 +25,7 @@ template = ${:_profile_base_location_}/${:filename} ...@@ -25,7 +25,7 @@ template = ${:_profile_base_location_}/${:filename}
rendered = ${buildout:directory}/instance-logrotate-base.cfg rendered = ${buildout:directory}/instance-logrotate-base.cfg
context = context =
key dcron_location dcron:location key dcron_location dcron:location
key gzip_location gzip:location key xz_location xz-utils:location
key logrotate_location logrotate:location key logrotate_location logrotate:location
key logrotate_conf_template logrotate-conf-template:target key logrotate_conf_template logrotate-conf-template:target
key logrotate_entry_template logrotate-entry-template:target key logrotate_entry_template logrotate-entry-template:target
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
# not need these here). # not need these here).
[logrotate-conf-template] [logrotate-conf-template]
filename = logrotate.conf.in filename = logrotate.conf.in
md5sum = 67954c82a8030e5dcac3a8c5d115f624 md5sum = 2fc0ea335969ffab7d8c4f98e3d04ae7
[logrotate-entry-template] [logrotate-entry-template]
filename = logrotate_entry.in filename = logrotate_entry.in
...@@ -22,4 +22,4 @@ md5sum = 117e46af6d9d31c09eeb86089d11407e ...@@ -22,4 +22,4 @@ md5sum = 117e46af6d9d31c09eeb86089d11407e
[template-logrotate-base] [template-logrotate-base]
filename = instance-logrotate-base.cfg.in filename = instance-logrotate-base.cfg.in
md5sum = f56b86a0742afff931a5e972114566e4 md5sum = e2aec5faa92f1c9f4b436eae1a3e6881
...@@ -28,8 +28,8 @@ wrapper = ${logrotate-directory:bin}/cron_simplelogger ...@@ -28,8 +28,8 @@ wrapper = ${logrotate-directory:bin}/cron_simplelogger
log = ${logrotate-directory:log}/cron.log log = ${logrotate-directory:log}/cron.log
[logrotate-conf-parameter] [logrotate-conf-parameter]
gzip-binary = {{ gzip_location }}/bin/gzip compress-binary = {{ xz_location }}/bin/xz
gunzip-binary = {{ gzip_location }}/bin/gunzip uncompress-binary = {{ xz_location }}/bin/unxz
logrotate-entries = ${logrotate-directory:logrotate-entries} logrotate-entries = ${logrotate-directory:logrotate-entries}
[logrotate-conf] [logrotate-conf]
...@@ -91,5 +91,5 @@ bin = ${buildout:directory}/bin ...@@ -91,5 +91,5 @@ bin = ${buildout:directory}/bin
srv = ${buildout:directory}/srv srv = ${buildout:directory}/srv
backup = ${:srv}/backup backup = ${:srv}/backup
etc = ${buildout:directory}/etc etc = ${buildout:directory}/etc
services = ${:etc}/run services = ${:etc}/service
log = ${buildout:directory}/var/log log = ${buildout:directory}/var/log
compresscmd {{ parameter_dict['gzip-binary'] }} compresscmd {{ parameter_dict['compress-binary'] }}
compressoptions -9 compressoptions -9
uncompresscmd {{ parameter_dict['gunzip-binary'] }} uncompresscmd {{ parameter_dict['uncompress-binary'] }}
include {{ parameter_dict['logrotate-entries'] }} include {{ parameter_dict['logrotate-entries'] }}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment