Commit cb34d581 authored by Łukasz Nowak's avatar Łukasz Nowak

Install tidstorage server wrapper with its log rotation.

Fix log rotation for zeo after begin multiplicized.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@45832 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 83fd5e49
...@@ -513,7 +513,7 @@ class Recipe(BaseSlapRecipe): ...@@ -513,7 +513,7 @@ class Recipe(BaseSlapRecipe):
self._createDirectory(server_dir) self._createDirectory(server_dir)
zeo_event_log = os.path.join(self.log_directory, 'zeo-%s.log'% zeo_number) zeo_event_log = os.path.join(self.log_directory, 'zeo-%s.log'% zeo_number)
zeo_pid = os.path.join(self.run_directory, 'zeo-%s.pid'% zeo_number) zeo_pid = os.path.join(self.run_directory, 'zeo-%s.pid'% zeo_number)
self.registerLogRotation('zeo', [zeo_event_log], self.registerLogRotation('zeo-%s' % zeo_number, [zeo_event_log],
self.killpidfromfile + ' ' + zeo_pid + ' SIGUSR2') self.killpidfromfile + ' ' + zeo_pid + ' SIGUSR2')
config = dict( config = dict(
zeo_ip=ip, zeo_ip=ip,
...@@ -558,23 +558,37 @@ class Recipe(BaseSlapRecipe): ...@@ -558,23 +558,37 @@ class Recipe(BaseSlapRecipe):
backup_base_path = self.createBackupDirectory('zodb') backup_base_path = self.createBackupDirectory('zodb')
# it is time to fill known_tid_storage_identifier_dict with backup # it is time to fill known_tid_storage_identifier_dict with backup
# destination # destination
raise NotImplementedError
for k, v in known_tid_storage_identifier_dict.iteritems(): for k, v in known_tid_storage_identifier_dict.iteritems():
# generate unique name for each backup # generate unique name for each backup
name = '_'.join(['_'.join([str(q) for q in k[0]]), k[1]]) name = '_'.join(['_'.join([str(q) for q in k[0]]), k[1]])
destination = os.path.join(backup_base_path, name) destination = os.path.join(backup_base_path, name)
self._createDirectory(destination) self._createDirectory(destination)
known_tid_storage_identifier_dict[k] = (v[0], destination, v[1]) known_tid_storage_identifier_dict[k] = (v[0], destination, v[1])
self.createConfigurationFile('tidstorage.py', self.substituteTemplate( logfile = os.path.join(self.log_directory, 'tidstorage.log')
self.getTemplateFilename('tidstorage.py.in'), dict( pidfile = os.path.join(self.run_directory, 'tidstorage.pid')
timestamp_file_path = os.path.join(self.log_directory,
'repozo_tidstorage_timestamp.log')
tidstorage_config = self.createConfigurationFile('tidstorage.py',
self.substituteTemplate(self.getTemplateFilename('tidstorage.py.in'),
dict(
known_tid_storage_identifier_dict=pprint.pformat( known_tid_storage_identifier_dict=pprint.pformat(
known_tid_storage_identifier_dict), known_tid_storage_identifier_dict),
base_url='s/%%' % access_url, base_url='%s/%%' % access_url,
host=ip, host=ip,
port=port, port=port,
timestamp_file_path=os.path.join(self.log_directory, timestamp_file_path=timestamp_file_path,
'repozo_tidstorage_timestamp.log'), logfile=logfile,
pidfile=pidfile
))) )))
tidstorage_server = zc.buildout.easy_install.scripts([('tidstoraged',
__name__ + '.execute', 'execute')], self.ws, sys.executable,
self.wrapper_directory, arguments=[
self.options['tidstoraged_binary'], '--nofork', '--config',
tidstorage_config])[0]
self.registerLogRotation('tidsorage', [logfile, timestamp_file_path],
self.killpidfromfile + ' ' + pidfile + ' SIGHUP')
self.path_list.append(tidstorage_config)
self.path_list.append(tidstorage_server)
raise NotImplementedError raise NotImplementedError
def installZope(self, ip, port, name, zodb_configuration_string, def installZope(self, ip, port, name, zodb_configuration_string,
......
known_tid_storage_identifier_dict = %(known_tid_storage_identifier_dict)s known_tid_storage_identifier_dict = %(known_tid_storage_identifier_dict)s
base_url = '%(base_url)s' base_url = '%(base_url)s'
host = '%(host)s' address = '%(host)s'
port = %(port)s port = %(port)s
#logfile_name = 'tidstorage.log'
#pidfile_name = 'tidstorage.pid'
#fork = False #fork = False
#setuid = None #setuid = None
#setgid = None #setgid = None
...@@ -13,3 +11,5 @@ burst_period = 30 ...@@ -13,3 +11,5 @@ burst_period = 30
full_dump_period = 300 full_dump_period = 300
timestamp_file_path = '%(timestamp_file_path)s' timestamp_file_path = '%(timestamp_file_path)s'
logfile_name = '%(logfile)s'
pidfile_name = '%(pidfile)s'
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