Commit 4d6144f4 authored by Łukasz Nowak's avatar Łukasz Nowak

Instantiate tidstorage.

parent bfda7f33
......@@ -89,5 +89,6 @@ setup(name=name,
'generic.zope.zeo.client = slapos.recipe.generic_zope_zeo_client:Recipe',
'generate.erp5.tidstorage = slapos.recipe.generate_erp5_tidstorage:Recipe',
'zeo = slapos.recipe.zeo:Recipe',
'tidstorage = slapos.recipe.tidstorage:Recipe'
]},
)
......@@ -147,7 +147,6 @@ class Recipe(GenericSlapRecipe):
prepend = open(self.options['snippet-master']).read() % dict(
part_list=' \n'.join([' '+q for q in part_list]),
known_tid_storage_identifier_dict=known_tid_storage_identifier_dict,
site_id=site_id,
haproxy_section="haproxy-%s" % backend_name,
)
output = prepend + output
......
##############################################################################
#
# Copyright (c) 2011 Vifib SARL and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
import os
from slapos.recipe.librecipe import GenericBaseRecipe
class Recipe(GenericBaseRecipe):
def install(self):
path_list = []
a = path_list.append
configuration_file = self.createFile(self.options['configuration-path'], self.substituteTemplate(self.getTemplateFilename('tidstorage.py.in'), self.options))
a(configuration_file)
tidstorage_wrapper = self.createPythonScript(self.options['tidstorage-wrapper'], 'slapos.recipe.librecipe.execute.execute', [self.options['tidstoraged-binary'], '--nofork', '--config', configuration_file])
a(tidstorage_wrapper)
repozo_wrapper = self.createPythonScript(self.options['repozo-wrapper'], 'slapos.recipe.librecipe.execute.execute', [self.options['tidstorage-repozo-binary'], '--config', configuration_file, '--repozo', self.options['repozo-binary'], '-z'])
a(repozo_wrapper)
return path_list
known_tid_storage_identifier_dict = %(known-tid-storage-identifier-dict)s
base_url = '%(base-url)s'
address = '%(ip)s'
port = %(port)s
#fork = False
#setuid = None
#setgid = None
burst_period = 30
full_dump_period = 300
timestamp_file_path = '%(timestamp-file-path)s'
logfile_name = '%(logfile-name)s'
pidfile_name = '%(pidfile-name)s'
status_file = '%(status-file)s'
......@@ -19,8 +19,6 @@ runTestSuite_binary = ${buildout:bin-directory}/runTestSuite
runUnitTest_binary = ${buildout:bin-directory}/runUnitTest
runzope_binary = ${buildout:bin-directory}/runzope
sphinx_searchd_binary = ${sphinx:location}/bin/searchd
tidstorage_repozo_binary = ${buildout:bin-directory}/tidstorage_repozo
tidstoraged_binary = ${buildout:bin-directory}/tidstoraged
zabbix_agentd_binary = ${zabbix-agent:location}/sbin/zabbix_agentd
link_binary_list =
......
......@@ -17,6 +17,8 @@ parts =
cron-entry-logrotate
certificate-authority
tidstorage
cron-entry-tidstorage-backup
logrotate-entry-tidstorage
%(part_list)s
eggs-directory = ${buildout:eggs-directory}
......@@ -26,8 +28,7 @@ offline = true
[tidstorage]
recipe = slapos.cookbook:tidstorage
known-tid-storage-identifier-dict = %(known_tid_storage_identifier_dict)s
site-id = %(site_id)s
base_url = 'http://$${%(haproxy_section)s:ip}:$${%(haproxy_section)s:port}/$${:site-id}/serialize'
base-url = http://$${%(haproxy_section)s:ip}:$${%(haproxy_section)s:port}/%%s/serialize
configuration-path = $${rootdirectory:etc}/tidstorage.py
ip = $${slap-network-information:local-ipv4}
port = 6001
......@@ -35,6 +36,25 @@ timestamp-file-path = $${directory:tidstorage}/repozo_tidstorage_timestamp.log
logfile-name = $${basedirectory:log}/tidstorage.log
pidfile-name = $${basedirectory:run}/tidstorage.pid
status-file = $${directory:tidstorage}/tidstorage.tid
tidstorage-repozo-binary = ${buildout:bin-directory}/tidstorage_repozo
tidstoraged-binary = ${buildout:bin-directory}/tidstoraged
repozo-binary = ${buildout:bin-directory}/repozo
tidstorage-wrapper = $${basedirectory:services}/tidstoraged
repozo-wrapper = $${buildout:bin-directory}/tidstorage-repozo
[cron-entry-tidstorage-backup]
<= cron
recipe = slapos.cookbook:cron.d
name = logrotate
frequency = 0 0 * * *
command = $${tidstorage:repozo-wrapper}
[logrotate-entry-tidstorage]
<= logrotate
recipe = slapos.cookbook:logrotate.d
name = tidstorage
log = $${tidstorage:logfile-name}
post = ${buildout:bin-directory}/killpidfromfile $${tidstorage:pidfile-name} SIGHUP
[directory]
recipe = slapos.cookbook:mkdirectory
......
......@@ -60,7 +60,7 @@ configurator_bt5_list = erp5_core_proxy_field_legacy erp5_full_text_myisam_catal
[template]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance.cfg
md5sum = 52f3c27de3e9e5f9223084829c3ed2f6
md5sum = c83acb5533187359b8730072d95ecf92
output = ${buildout:directory}/template.cfg
mode = 0644
......@@ -88,7 +88,7 @@ mode = 0644
[template-snippet-master]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/snippet-master.cfg
md5sum = d510b8ebbb3325ed7a6a9b6005f78e37
md5sum = fa1ac57e290cc6823e60fba068bb6a3c
output = ${buildout:directory}/template-snippet-master.cfg
mode = 0644
......
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