Commit 61711abc authored by Julien Muchembled's avatar Julien Muchembled

logging: refactoring of crond/logrotate for NEO & ERP5

New 'slapos-kill' from slapos.toolbox is used instead of 'killpidfromfile'
This is required for NEO which does not write any pid file.
parent 7ece1a48
[buildout] [buildout]
parts = extends = {{ logrotate_cfg }}
parts +=
neo-admin-promise neo-admin-promise
logrotate-admin
[neo-admin] [neo-admin]
recipe = slapos.cookbook:neoppod.admin recipe = slapos.cookbook:neoppod.admin
...@@ -30,3 +32,11 @@ recipe = slapos.cookbook:check_port_listening ...@@ -30,3 +32,11 @@ recipe = slapos.cookbook:check_port_listening
hostname = ${neo-admin:ip} hostname = ${neo-admin:ip}
port = ${neo-admin:port} port = ${neo-admin:port}
path = ${directory:promises}/neo-admin-promise path = ${directory:promises}/neo-admin-promise
[logrotate-admin]
recipe = slapos.cookbook:logrotate.d
logrotate-entries = ${logrotate:logrotate-entries}
backup = ${logrotate:backup}
name = neo-admin
log = ${neo-admin:logfile}
post = {{ bin_directory }}/slapos-kill -n neoadmin -s RTMIN+1 ${:log}
[buildout] [buildout]
parts = extends = {{ logrotate_cfg }}
parts +=
neo-master-promise neo-master-promise
logrotate-master
[neo-master] [neo-master]
recipe = slapos.cookbook:neoppod.master recipe = slapos.cookbook:neoppod.master
...@@ -36,3 +38,11 @@ recipe = slapos.cookbook:check_port_listening ...@@ -36,3 +38,11 @@ recipe = slapos.cookbook:check_port_listening
hostname = ${neo-master:ip} hostname = ${neo-master:ip}
port = ${neo-master:port} port = ${neo-master:port}
path = ${directory:promises}/neo-master-promise path = ${directory:promises}/neo-master-promise
[logrotate-master]
recipe = slapos.cookbook:logrotate.d
logrotate-entries = ${logrotate:logrotate-entries}
backup = ${logrotate:backup}
name = neo-master
log = ${neo-master:logfile}
post = {{ bin_directory }}/slapos-kill -n neomaster -s RTMIN+1 ${:log}
[buildout] [buildout]
extends = {{ master_cfg }} extends = {{ master_cfg }}
parts += neo-storage parts +=
neo-storage
logrotate-storage
[mariadb-instance] [mariadb-instance]
recipe = slapos.cookbook:generic.mysql recipe = slapos.cookbook:generic.mysql
...@@ -45,3 +47,11 @@ var = ${buildout:directory}/var ...@@ -45,3 +47,11 @@ var = ${buildout:directory}/var
etc_run = ${:etc}/run etc_run = ${:etc}/run
var_run = ${:var}/run var_run = ${:var}/run
srv_mariadb = ${buildout:directory}/srv/mariadb srv_mariadb = ${buildout:directory}/srv/mariadb
[logrotate-storage]
recipe = slapos.cookbook:logrotate.d
logrotate-entries = ${logrotate:logrotate-entries}
backup = ${logrotate:backup}
name = neo-storage
log = ${neo-storage:logfile}
post = {{ bin_directory }}/slapos-kill -n neostorage -s RTMIN+1 ${:log}
...@@ -22,6 +22,7 @@ context = ...@@ -22,6 +22,7 @@ context =
key ipv4_set slap-configuration:ipv4 key ipv4_set slap-configuration:ipv4
raw bin_directory {{ bin_directory }} raw bin_directory {{ bin_directory }}
key slapparameter_dict slap-configuration:configuration key slapparameter_dict slap-configuration:configuration
raw logrotate_cfg {{ logrotate_base }}
${:extra-context} ${:extra-context}
[neo-cluster] [neo-cluster]
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
[buildout] [buildout]
extends = extends =
../../stack/slapos.cfg ../../stack/slapos.cfg
../../stack/erp5/logrotate-base.cfg
#LXML #LXML
../../component/lxml-python/buildout.cfg ../../component/lxml-python/buildout.cfg
#END LXML #END LXML
...@@ -28,9 +29,10 @@ parts = ...@@ -28,9 +29,10 @@ parts =
[slapos-deps-eggs] [slapos-deps-eggs]
recipe = zc.recipe.egg recipe = zc.recipe.egg
eggs = eggs =
#LXML
${lxml-python:egg} ${lxml-python:egg}
#END LXML slapos.toolbox
scripts =
slapos-kill
[cluster] [cluster]
recipe = slapos.recipe.build:download recipe = slapos.recipe.build:download
...@@ -39,20 +41,20 @@ md5sum = 84cba584198a26289daacb3e6d199e2b ...@@ -39,20 +41,20 @@ md5sum = 84cba584198a26289daacb3e6d199e2b
[instance-neo-admin] [instance-neo-admin]
< = cluster < = cluster
md5sum = d9213500262acd61f0bb8e840b9af18b md5sum = 43eb053841e9dabdbed2a3501a0a3f13
[instance-neo-master] [instance-neo-master]
< = cluster < = cluster
md5sum = 00e2a270d6d4e15b77e2e651ee5e7fa9 md5sum = 25724ba46203c57b680976dbe4ba67b7
[instance-neo-storage-mysql] [instance-neo-storage-mysql]
< = cluster < = cluster
md5sum = c9dcaf0f4d45dd9422c39ce6ae87dfb3 md5sum = 1117184530207258b194e27dbe724cd5
[template] [template]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template:jinja2
template = ${:_profile_base_location_}/instance.cfg.in template = ${:_profile_base_location_}/instance.cfg.in
md5sum = 1d427e8aca550efda1635b4ee112f8ac md5sum = c7147d7c09294385b4995f6480fd976e
# XXX: "template.cfg" is hardcoded in instanciation recipe # XXX: "template.cfg" is hardcoded in instanciation recipe
rendered = ${buildout:directory}/template.cfg rendered = ${buildout:directory}/template.cfg
context = context =
...@@ -64,6 +66,7 @@ context = ...@@ -64,6 +66,7 @@ context =
key neo_master instance-neo-master:target key neo_master instance-neo-master:target
key neo_storage_mysql instance-neo-storage-mysql:target key neo_storage_mysql instance-neo-storage-mysql:target
key mariadb_location mariadb:location key mariadb_location mariadb:location
key logrotate_base template-logrotate-base:rendered
[neoppod] [neoppod]
recipe = zc.recipe.egg recipe = zc.recipe.egg
......
{% if software_type == slap_software_type -%}
{% set part_list = [] -%} {% set part_list = [] -%}
{% set ssl_parameter_dict = slapparameter_dict.get('ssl', {}) %} {% set ssl_parameter_dict = slapparameter_dict.get('ssl', {}) %}
{% macro section(name) %}{% do part_list.append(name) %}{{ name }}{% endmacro -%} {% macro section(name) %}{% do part_list.append(name) %}{{ name }}{% endmacro -%}
...@@ -177,7 +176,7 @@ logrotate-entries = ${logrotate:logrotate-entries} ...@@ -177,7 +176,7 @@ logrotate-entries = ${logrotate:logrotate-entries}
backup = ${logrotate:backup} backup = ${logrotate:backup}
name = apache name = apache
log = ${apache-conf-parameter-dict:error-log} ${apache-conf-parameter-dict:access-log} log = ${apache-conf-parameter-dict:error-log} ${apache-conf-parameter-dict:access-log}
post = {{ parameter_dict['bin-directory'] }}/killpidfromfile ${apache-conf-parameter-dict:pid-file} SIGUSR1 post = {{ parameter_dict['bin-directory'] }}/slapos-kill --pidfile ${apache-conf-parameter-dict:pid-file} -s USR1
[directory] [directory]
recipe = slapos.cookbook:mkdirectory recipe = slapos.cookbook:mkdirectory
...@@ -197,13 +196,9 @@ newcerts = ${:ca-dir}/newcerts ...@@ -197,13 +196,9 @@ newcerts = ${:ca-dir}/newcerts
crl = ${:ca-dir}/crl crl = ${:ca-dir}/crl
[buildout] [buildout]
extends = {{ parameter_dict['instance-logrotate-cfg'] }} extends = {{ logrotate_cfg }}
parts += parts +=
publish publish
logrotate-apache logrotate-apache
apache-certificate-authority apache-certificate-authority
{{ part_list | join('\n ') }} {{ part_list | join('\n ') }}
eggs-directory = {{ eggs_directory }}
develop-eggs-directory = {{ develop_eggs_directory }}
{% endif %}
{% if slap_software_type == software_type -%}
{% set frontend_dict = slapparameter_dict.get('frontend', {}) %} {% set frontend_dict = slapparameter_dict.get('frontend', {}) %}
{% set has_frontend = frontend_dict.get('software-url', '') != '' -%} {% set has_frontend = frontend_dict.get('software-url', '') != '' -%}
{% set site_id = slapparameter_dict.get('site-id', 'erp5') -%} {% set site_id = slapparameter_dict.get('site-id', 'erp5') -%}
...@@ -239,6 +238,3 @@ hosts-dict = {{ '${' ~ zope_address_list_id_dict.keys()[0] ~ ':connection-hosts- ...@@ -239,6 +238,3 @@ hosts-dict = {{ '${' ~ zope_address_list_id_dict.keys()[0] ~ ':connection-hosts-
[buildout] [buildout]
parts = publish parts = publish
eggs-directory = {{ eggs_directory }}
develop-eggs-directory = {{ develop_eggs_directory }}
{% endif %}
...@@ -54,29 +54,16 @@ dummy += ...@@ -54,29 +54,16 @@ dummy +=
extra-paths += extra-paths +=
${vifib:location}/master ${vifib:location}/master
[download-base-part]
recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/${:filename}
mode = 644
[template-erp5] [template-erp5]
< = download-base-part md5sum = 1b1ba4a3d57e6f91eb86e36b19f75463
filename = instance-erp5.cfg.in
md5sum = e6e7e8add73df0bc7823dee2dd916d62
[template-balancer] [template-balancer]
< = download-base-part md5sum = 818ab59ae966114735866aecef7a8563
filename = instance-balancer.cfg.in
md5sum = 08b9ef093af926378b58d384539b3417
[template-apache-conf] [template-apache-conf]
< = download-base-part
filename = apache.conf.in
md5sum = bb329fc28bef095a01efc901d2f84149 md5sum = bb329fc28bef095a01efc901d2f84149
[template-create-erp5-site-real] [template-create-erp5-site-real]
< = download-base-part
filename = instance-create-erp5-site-real.cfg.in
md5sum = 61824aab2172d21f1d6403a35cab47cd md5sum = 61824aab2172d21f1d6403a35cab47cd
......
...@@ -6,10 +6,8 @@ extends = ...@@ -6,10 +6,8 @@ extends =
# Exact version of Zope # Exact version of Zope
https://raw.github.com/zopefoundation/Zope/2.13.22/versions.cfg https://raw.github.com/zopefoundation/Zope/2.13.22/versions.cfg
../../stack/slapos.cfg ../../stack/slapos.cfg
../../component/logrotate/buildout.cfg
../../component/cups/buildout.cfg ../../component/cups/buildout.cfg
../../component/dbus/buildout.cfg ../../component/dbus/buildout.cfg
../../component/dcron/buildout.cfg
../../component/file/buildout.cfg ../../component/file/buildout.cfg
../../component/fonts/buildout.cfg ../../component/fonts/buildout.cfg
../../component/ghostscript/buildout.cfg ../../component/ghostscript/buildout.cfg
...@@ -56,6 +54,7 @@ extends = ...@@ -56,6 +54,7 @@ extends =
../../component/6tunnel/buildout.cfg ../../component/6tunnel/buildout.cfg
../../component/findutils/buildout.cfg ../../component/findutils/buildout.cfg
../../component/userhosts/buildout.cfg ../../component/userhosts/buildout.cfg
logrotate-base.cfg
parts = parts =
erp5-util-develop erp5-util-develop
...@@ -91,7 +90,6 @@ parts = ...@@ -91,7 +90,6 @@ parts =
perl-DBI perl-DBI
percona-toolkit percona-toolkit
zabbix-agent zabbix-agent
dcron
dash dash
wget wget
userhosts userhosts
...@@ -159,7 +157,7 @@ context = ...@@ -159,7 +157,7 @@ context =
[template-mariadb] [template-mariadb]
< = download-base < = download-base
filename = instance-mariadb.cfg.in filename = instance-mariadb.cfg.in
md5sum = 17c9e0f260c6464493e10582e9239409 md5sum = 8a59e1730391fb3a859cd973cd7c3a5b
link-binary = link-binary =
${coreutils:location}/bin/basename ${coreutils:location}/bin/basename
${coreutils:location}/bin/cat ${coreutils:location}/bin/cat
...@@ -175,7 +173,7 @@ link-binary = ...@@ -175,7 +173,7 @@ link-binary =
[template-kumofs] [template-kumofs]
< = download-base < = download-base
filename = instance-kumofs.cfg.in filename = instance-kumofs.cfg.in
md5sum = 2e3230d57f2cfb3a9783fe808ccce08c md5sum = 5ebf310655d5de27da039d71a63d209b
[template-cloudooo] [template-cloudooo]
< = download-base < = download-base
...@@ -217,7 +215,7 @@ md5sum = e40e2e39f4941c6372f4357e8589a5cf ...@@ -217,7 +215,7 @@ md5sum = e40e2e39f4941c6372f4357e8589a5cf
# XXX: "template.cfg" is hardcoded in instanciation recipe # XXX: "template.cfg" is hardcoded in instanciation recipe
filename = template.cfg filename = template.cfg
template = ${:_profile_base_location_}/instance.cfg.in template = ${:_profile_base_location_}/instance.cfg.in
md5sum = 92398630799f98dd3bffb0f2802d07e3 md5sum = 5e303e59c6674c98944120d6f1d01c28
extra-context = extra-context =
key mariadb_link_binary template-mariadb:link-binary key mariadb_link_binary template-mariadb:link-binary
key zope_link_binary template-zope:link-binary key zope_link_binary template-zope:link-binary
...@@ -294,12 +292,12 @@ md5sum = 7dcac2eae332e2def17579888c045320 ...@@ -294,12 +292,12 @@ md5sum = 7dcac2eae332e2def17579888c045320
[template-zeo] [template-zeo]
< = download-base < = download-base
filename = instance-zeo.cfg.in filename = instance-zeo.cfg.in
md5sum = 9a34fa84f8d0cfc0698ed2527f63aa61 md5sum = 651fa2ec2feb768e339936b7855774ca
[template-zope] [template-zope]
< = download-base < = download-base
filename = instance-zope.cfg.in filename = instance-zope.cfg.in
md5sum = 91c5b56ba750cc4010bef4845b712861 md5sum = e128a47f37ba78dc7154daa80c2dd272
link-binary = link-binary =
${aspell:location}/bin/aspell ${aspell:location}/bin/aspell
${coreutils:location}/bin/basename ${coreutils:location}/bin/basename
...@@ -329,7 +327,7 @@ link-binary = ...@@ -329,7 +327,7 @@ link-binary =
[template-balancer] [template-balancer]
< = download-base < = download-base
filename = instance-balancer.cfg.in filename = instance-balancer.cfg.in
md5sum = fc13d528e76eb9567925077d5472b285 md5sum = 3628f0ba358e7ee96a8d0185c4775911
[template-apache-conf] [template-apache-conf]
< = download-base < = download-base
...@@ -341,15 +339,6 @@ md5sum = dedfe759c3421e0186703fe1257bae8f ...@@ -341,15 +339,6 @@ md5sum = dedfe759c3421e0186703fe1257bae8f
filename = haproxy.cfg.in filename = haproxy.cfg.in
md5sum = d27fe9218cb737d8a76ba5df4740f947 md5sum = d27fe9218cb737d8a76ba5df4740f947
[template-logrotate-base]
< = template-jinja2-base
filename = instance-logrotate-base.cfg
md5sum = af19ff0c7817df85987c69738fb083f2
extra-context =
key dcron_location dcron:location
key gzip_location gzip:location
key logrotate_location logrotate:location
[bt5-repository] [bt5-repository]
# Format: # Format:
# <url or path> [...] # <url or path> [...]
...@@ -590,8 +579,8 @@ eggs = ...@@ -590,8 +579,8 @@ eggs =
scripts = scripts =
is-local-tcp-port-opened is-local-tcp-port-opened
killpidfromfile
onetimedownload onetimedownload
slapos-kill
zodbpack zodbpack
[versions] [versions]
...@@ -696,7 +685,7 @@ restkit = 4.2.2 ...@@ -696,7 +685,7 @@ restkit = 4.2.2
rtjp-eventlet = 0.3.2 rtjp-eventlet = 0.3.2
slapos.recipe.build = 0.12 slapos.recipe.build = 0.12
slapos.recipe.template = 2.5 slapos.recipe.template = 2.5
slapos.toolbox = 0.41.0 slapos.toolbox = 0.43.0
smmap = 0.8.2 smmap = 0.8.2
socketpool = 0.5.3 socketpool = 0.5.3
spyne = 2.11.0 spyne = 2.11.0
......
...@@ -187,7 +187,7 @@ logrotate-entries = ${logrotate:logrotate-entries} ...@@ -187,7 +187,7 @@ logrotate-entries = ${logrotate:logrotate-entries}
backup = ${logrotate:backup} backup = ${logrotate:backup}
name = apache name = apache
log = ${apache-conf-parameter-dict:error-log} ${apache-conf-parameter-dict:access-log} log = ${apache-conf-parameter-dict:error-log} ${apache-conf-parameter-dict:access-log}
post = {{ parameter_dict['bin-directory'] }}/killpidfromfile ${apache-conf-parameter-dict:pid-file} SIGUSR1 post = {{ parameter_dict['bin-directory'] }}/slapos-kill --pidfile ${apache-conf-parameter-dict:pid-file} -s USR1
[directory] [directory]
recipe = slapos.cookbook:mkdirectory recipe = slapos.cookbook:mkdirectory
...@@ -207,7 +207,7 @@ newcerts = ${:ca-dir}/newcerts ...@@ -207,7 +207,7 @@ newcerts = ${:ca-dir}/newcerts
crl = ${:ca-dir}/crl crl = ${:ca-dir}/crl
[buildout] [buildout]
extends = {{ parameter_dict['instance-logrotate-cfg'] }} extends = {{ logrotate_cfg }}
parts += parts +=
publish publish
logrotate-apache logrotate-apache
......
{% set use_ipv6 = slapparameter_dict.get('use-ipv6', False) -%} {% set use_ipv6 = slapparameter_dict.get('use-ipv6', False) -%}
[buildout] [buildout]
parts = extends = {{ logrotate_cfg }}
parts +=
publish-kumofs-connection-information publish-kumofs-connection-information
kumofs-instance kumofs-instance
logrotate
logrotate-entry-kumofs logrotate-entry-kumofs
cron
cron-entry-logrotate
promise-kumofs-server promise-kumofs-server
promise-kumofs-server-listen promise-kumofs-server-listen
promise-kumofs-gateway promise-kumofs-gateway
...@@ -46,14 +44,14 @@ data-path = ${directory:kumofs-data}/kumodb.tch#bnum=10485760#opts=l ...@@ -46,14 +44,14 @@ data-path = ${directory:kumofs-data}/kumodb.tch#bnum=10485760#opts=l
{% endif -%} {% endif -%}
# Paths: Running wrappers # Paths: Running wrappers
gateway-wrapper = ${basedirectory:services}/kumofs_gateway gateway-wrapper = ${directory:services}/kumofs_gateway
manager-wrapper = ${basedirectory:services}/kumofs_manager manager-wrapper = ${directory:services}/kumofs_manager
server-wrapper = ${basedirectory:services}/kumofs_server server-wrapper = ${directory:services}/kumofs_server
# Paths: Logs # Paths: Logs
kumo-gateway-log = ${basedirectory:log}/kumo-gateway.log kumo-gateway-log = ${directory:log}/kumo-gateway.log
kumo-manager-log = ${basedirectory:log}/kumo-manager.log kumo-manager-log = ${directory:log}/kumo-manager.log
kumo-server-log = ${basedirectory:log}/kumo-server.log kumo-server-log = ${directory:log}/kumo-server.log
# Binary information # Binary information
kumo-gateway-binary = {{ parameter_dict['kumo-location'] }}/bin/kumo-gateway kumo-gateway-binary = {{ parameter_dict['kumo-location'] }}/bin/kumo-gateway
...@@ -62,70 +60,18 @@ kumo-server-binary = {{ parameter_dict['kumo-location'] }}/bin/kumo-server ...@@ -62,70 +60,18 @@ kumo-server-binary = {{ parameter_dict['kumo-location'] }}/bin/kumo-server
shell-path = {{ parameter_dict['dash-location'] }}/bin/dash shell-path = {{ parameter_dict['dash-location'] }}/bin/dash
[logrotate-entry-kumofs] [logrotate-entry-kumofs]
<= logrotate
recipe = slapos.cookbook:logrotate.d recipe = slapos.cookbook:logrotate.d
logrotate-entries = ${logrotate:logrotate-entries}
backup = ${logrotate:backup}
name = kumofs name = kumofs
log = ${kumofs-instance:kumo-gateway-log} ${kumofs-instance:kumo-manager-log} ${kumofs-instance:kumo-server-log} log = ${kumofs-instance:kumo-gateway-log} ${kumofs-instance:kumo-manager-log} ${kumofs-instance:kumo-server-log}
# rest of parts are candidates for some generic stuff
[logrotate]
recipe = slapos.cookbook:logrotate
# Binaries
logrotate-binary = {{ parameter_dict['logrotate-location'] }}/usr/sbin/logrotate
gzip-binary = {{ parameter_dict['gzip-location'] }}/bin/gzip
gunzip-binary = {{ parameter_dict['gzip-location'] }}/bin/gunzip
# Directories
wrapper = ${rootdirectory:bin}/logrotate
conf = ${rootdirectory:etc}/logrotate.conf
logrotate-entries = ${directory:logrotate-entries}
backup = ${directory:logrotate-backup}
state-file = ${rootdirectory:srv}/logrotate.status
[basedirectory]
recipe = slapos.cookbook:mkdirectory
log = ${rootdirectory:var}/log
services = ${rootdirectory:etc}/run
promise = ${rootdirectory:etc}/promise
run = ${rootdirectory:var}/run
backup = ${rootdirectory:srv}/backup
[directory] [directory]
recipe = slapos.cookbook:mkdirectory recipe = slapos.cookbook:mkdirectory
cron-entries = ${rootdirectory:etc}/cron.d log = ${buildout:directory}/var/log
crontabs = ${rootdirectory:etc}/crontabs services = ${buildout:directory}/etc/run
cronstamps = ${rootdirectory:etc}/cronstamps promise = ${buildout:directory}/etc/promise
logrotate-backup = ${basedirectory:backup}/logrotate kumofs-data = ${buildout:directory}/srv/kumofs
logrotate-entries = ${rootdirectory:etc}/logrotate.d
kumofs-data = ${rootdirectory:srv}/kumofs
[rootdirectory]
recipe = slapos.cookbook:mkdirectory
etc = ${buildout:directory}/etc
var = ${buildout:directory}/var
srv = ${buildout:directory}/srv
bin = ${buildout:directory}/bin
[cron]
recipe = slapos.cookbook:cron
dcrond-binary = {{ parameter_dict['dcron-location'] }}/sbin/crond
cron-entries = ${directory:cron-entries}
crontabs = ${directory:crontabs}
cronstamps = ${directory:cronstamps}
catcher = ${cron-simplelogger:wrapper}
binary = ${basedirectory:services}/crond
[cron-simplelogger]
recipe = slapos.cookbook:simplelogger
wrapper = ${rootdirectory:bin}/cron_simplelogger
log = ${basedirectory:log}/cron.log
[cron-entry-logrotate]
<= cron
recipe = slapos.cookbook:cron.d
name = logrotate
frequency = 0 0 * * *
command = ${logrotate:wrapper}
# Deploy zope promises scripts # Deploy zope promises scripts
[promise-template] [promise-template]
...@@ -135,20 +81,20 @@ port = ${kumofs-instance:server-listen-port} ...@@ -135,20 +81,20 @@ port = ${kumofs-instance:server-listen-port}
[promise-kumofs-server] [promise-kumofs-server]
<= promise-template <= promise-template
path = ${basedirectory:promise}/kumofs-server path = ${directory:promise}/kumofs-server
port = ${kumofs-instance:server-port} port = ${kumofs-instance:server-port}
[promise-kumofs-server-listen] [promise-kumofs-server-listen]
<= promise-template <= promise-template
path = ${basedirectory:promise}/kumofs-server-listen path = ${directory:promise}/kumofs-server-listen
port = ${kumofs-instance:server-listen-port} port = ${kumofs-instance:server-listen-port}
[promise-kumofs-gateway] [promise-kumofs-gateway]
<= promise-template <= promise-template
path = ${basedirectory:promise}/kumofs-gateway path = ${directory:promise}/kumofs-gateway
port = ${kumofs-instance:gateway-port} port = ${kumofs-instance:gateway-port}
[promise-kumofs-manager] [promise-kumofs-manager]
<= promise-template <= promise-template
path = ${basedirectory:promise}/kumofs-manager path = ${directory:promise}/kumofs-manager
port = ${kumofs-instance:manager-port} port = ${kumofs-instance:manager-port}
...@@ -218,8 +218,7 @@ wrapper-path = ${directory:promise}/mariadb ...@@ -218,8 +218,7 @@ wrapper-path = ${directory:promise}/mariadb
parameters-extra = true parameters-extra = true
[buildout] [buildout]
extends = extends = {{ logrotate_cfg }}
{{ parameter_dict['instance-logrotate-cfg'] }}
parts += parts +=
publish-mariadb-url publish-mariadb-url
logrotate-entry-mariadb logrotate-entry-mariadb
......
...@@ -93,7 +93,7 @@ storage = {{ dumps(storage_list) }} ...@@ -93,7 +93,7 @@ storage = {{ dumps(storage_list) }}
< = logrotate-base < = logrotate-base
name = {{ "${" ~ zeo_section_name ~ ":base-name}" }} name = {{ "${" ~ zeo_section_name ~ ":base-name}" }}
log = {{ "${" ~ zeo_section_name ~ ":log-path}" }} log = {{ "${" ~ zeo_section_name ~ ":log-path}" }}
post = {{ bin_directory }}/killpidfromfile {{ "${" ~ zeo_section_name ~ ":pid-path}" }} SIGUSR2 post = {{ bin_directory }}/slapos-kill --pidfile {{ "${" ~ zeo_section_name ~ ":pid-path}" }} -s USR2
[{{ section(zeo_section_name ~ "-promise") }}] [{{ section(zeo_section_name ~ "-promise") }}]
recipe = slapos.cookbook:check_port_listening recipe = slapos.cookbook:check_port_listening
...@@ -189,7 +189,7 @@ wrapper-path = ${directory:bin}/cron-purge-repozo-fsindex ...@@ -189,7 +189,7 @@ wrapper-path = ${directory:bin}/cron-purge-repozo-fsindex
< = logrotate-base < = logrotate-base
name = tidstorage name = tidstorage
log = ${tidstorage:logfile-name} log = ${tidstorage:logfile-name}
post = {{ bin_directory }}/killpidfromfile ${tidstorage:pidfile-name} SIGHUP post = {{ bin_directory }}/slapos-kill --pidfile ${tidstorage:pidfile-name} -s HUP
{% else -%} {% else -%}
[tidstorage] [tidstorage]
ip = ip =
...@@ -226,8 +226,7 @@ zodb = {{ default_zodb_path }} ...@@ -226,8 +226,7 @@ zodb = {{ default_zodb_path }}
tidstorage = {{ default_tidstorage_timestamp_path }} tidstorage = {{ default_tidstorage_timestamp_path }}
[buildout] [buildout]
extends = extends = {{ logrotate_cfg }}
{{ parameter_dict['instance-logrotate-cfg'] }}
parts += parts +=
{{ part_list | join('\n ') }} {{ part_list | join('\n ') }}
publish publish
...@@ -325,7 +325,7 @@ path = ${directory:promises}/{{ zope_tunnel_base_name }} ...@@ -325,7 +325,7 @@ path = ${directory:promises}/{{ zope_tunnel_base_name }}
< = logrotate-entry-base < = logrotate-entry-base
name = {{ name }} name = {{ name }}
log = {{ '${' ~ conf_parameter_name ~ ':event-log}' }} {{ '${' ~ conf_parameter_name ~ ':z2-log}' }} {{ '${' ~ name ~ ':longrequest-logger-file}' }} log = {{ '${' ~ conf_parameter_name ~ ':event-log}' }} {{ '${' ~ conf_parameter_name ~ ':z2-log}' }} {{ '${' ~ name ~ ':longrequest-logger-file}' }}
post = {{ bin_directory }}/killpidfromfile {{ '${' ~ conf_parameter_name ~ ':pid-file}' }} SIGUSR2 post = {{ bin_directory }}/slapos-kill --pidfile {{ '${' ~ conf_parameter_name ~ ':pid-file}' }} -s USR2
{% endmacro -%} {% endmacro -%}
{% for i in range(slapparameter_dict['instance-count']) -%} {% for i in range(slapparameter_dict['instance-count']) -%}
...@@ -361,8 +361,7 @@ bt5 = {{ dumps(slapparameter_dict['bt5']) }} ...@@ -361,8 +361,7 @@ bt5 = {{ dumps(slapparameter_dict['bt5']) }}
bt5-repository-url = {{ dumps(slapparameter_dict['bt5-repository-url']) }} bt5-repository-url = {{ dumps(slapparameter_dict['bt5-repository-url']) }}
[buildout] [buildout]
extends = extends = {{ logrotate_cfg }}
{{ parameter_dict['instance-logrotate-cfg'] }}
parts += parts +=
erp5-promise erp5-promise
{{ part_list | join('\n ') }} {{ part_list | join('\n ') }}
......
...@@ -21,6 +21,7 @@ context = ...@@ -21,6 +21,7 @@ context =
key slapparameter_dict slap-configuration:configuration key slapparameter_dict slap-configuration:configuration
key computer_id slap-configuration:computer key computer_id slap-configuration:computer
raw slapos_core_version {{ slapos_core_version }} raw slapos_core_version {{ slapos_core_version }}
raw logrotate_cfg {{ template_logrotate_base }}
${:extra-context} ${:extra-context}
[dynamic-template-cloudooo-parameters] [dynamic-template-cloudooo-parameters]
...@@ -70,7 +71,6 @@ extra-context = ...@@ -70,7 +71,6 @@ extra-context =
apache = {{ apache_location }} apache = {{ apache_location }}
openssl = {{ openssl_location }} openssl = {{ openssl_location }}
haproxy = {{ haproxy_location }} haproxy = {{ haproxy_location }}
instance-logrotate-cfg = {{ template_logrotate_base }}
bin-directory = {{ bin_directory }} bin-directory = {{ bin_directory }}
6tunnel = {{ sixtunnel_location }} 6tunnel = {{ sixtunnel_location }}
dash = {{ dash_location }} dash = {{ dash_location }}
...@@ -93,7 +93,6 @@ extensions = jinja2.ext.do ...@@ -93,7 +93,6 @@ extensions = jinja2.ext.do
[dynamic-template-zeo-parameters] [dynamic-template-zeo-parameters]
buildout-bin-directory = {{ buildout_bin_directory }} buildout-bin-directory = {{ buildout_bin_directory }}
instance-logrotate-cfg = {{ template_logrotate_base }}
6tunnel = {{ sixtunnel_location }} 6tunnel = {{ sixtunnel_location }}
dash = {{ dash_location }} dash = {{ dash_location }}
findutils-location = {{ findutils_location }} findutils-location = {{ findutils_location }}
...@@ -111,7 +110,6 @@ extra-context = ...@@ -111,7 +110,6 @@ extra-context =
[dynamic-template-zope-parameters] [dynamic-template-zope-parameters]
bin-directory = {{ bin_directory }} bin-directory = {{ bin_directory }}
zope-conf-template = {{ template_zope_conf }} zope-conf-template = {{ template_zope_conf }}
instance-logrotate-cfg = {{ template_logrotate_base }}
buildout-bin-directory = {{ buildout_bin_directory }} buildout-bin-directory = {{ buildout_bin_directory }}
6tunnel = {{ sixtunnel_location }} 6tunnel = {{ sixtunnel_location }}
dash = {{ dash_location }} dash = {{ dash_location }}
...@@ -146,15 +144,12 @@ extra-context = ...@@ -146,15 +144,12 @@ extra-context =
[dynamic-template-mariadb-parameters] [dynamic-template-mariadb-parameters]
coreutils-location = {{ coreutils_location }} coreutils-location = {{ coreutils_location }}
dcron-location = {{ dcron_location }}
findutils-location = {{ findutils_location }} findutils-location = {{ findutils_location }}
gzip-location = {{ gzip_location }} gzip-location = {{ gzip_location }}
logrotate-location = {{ logrotate_location }}
mariadb-location = {{ mariadb_location }} mariadb-location = {{ mariadb_location }}
template-my-cnf = {{ template_my_cnf }} template-my-cnf = {{ template_my_cnf }}
template-mariadb-initial-setup = {{ template_mariadb_initial_setup }} template-mariadb-initial-setup = {{ template_mariadb_initial_setup }}
link-binary = {{ dumps(mariadb_link_binary) }} link-binary = {{ dumps(mariadb_link_binary) }}
instance-logrotate-cfg = {{ template_logrotate_base }}
bin-directory = {{ bin_directory }} bin-directory = {{ bin_directory }}
[dynamic-template-mariadb] [dynamic-template-mariadb]
......
# also extended by software/neoppod
[buildout]
extends =
../../component/dcron/buildout.cfg
../../component/gzip/buildout.cfg
../../component/logrotate/buildout.cfg
[template-logrotate-base]
recipe = slapos.recipe.template:jinja2
template = ${:_profile_base_location_}/${:filename}.in
rendered = ${buildout:directory}/${:filename}
filename = instance-logrotate-base.cfg
md5sum = af19ff0c7817df85987c69738fb083f2
context =
key dcron_location dcron:location
key gzip_location gzip:location
key logrotate_location logrotate:location
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