Move apache_frontend wrappers to watched directory (etc/service)

parent da9e0acd
...@@ -43,6 +43,9 @@ class Recipe(BaseSlapRecipe): ...@@ -43,6 +43,9 @@ class Recipe(BaseSlapRecipe):
'template/%s' % template_name) 'template/%s' % template_name)
def _install(self): def _install(self):
# Define directory not defined in deprecated lib
self.service_directory = os.path.join(self.etc_directory, 'service')
# Check for mandatory arguments # Check for mandatory arguments
frontend_domain_name = self.parameter_dict.get("domain") frontend_domain_name = self.parameter_dict.get("domain")
if frontend_domain_name is None: if frontend_domain_name is None:
...@@ -294,7 +297,7 @@ class Recipe(BaseSlapRecipe): ...@@ -294,7 +297,7 @@ class Recipe(BaseSlapRecipe):
self._createDirectory(crontabs) self._createDirectory(crontabs)
wrapper = zc.buildout.easy_install.scripts([('crond', wrapper = zc.buildout.easy_install.scripts([('crond',
'slapos.recipe.librecipe.execute', 'execute')], self.ws, sys.executable, 'slapos.recipe.librecipe.execute', 'execute')], self.ws, sys.executable,
self.wrapper_directory, arguments=[ self.service_directory, arguments=[
self.options['dcrond_binary'].strip(), '-s', cron_d, '-c', crontabs, self.options['dcrond_binary'].strip(), '-s', cron_d, '-c', crontabs,
'-t', timestamps, '-f', '-l', '5', '-M', catcher] '-t', timestamps, '-f', '-l', '5', '-M', catcher]
)[0] )[0]
...@@ -357,7 +360,7 @@ class Recipe(BaseSlapRecipe): ...@@ -357,7 +360,7 @@ class Recipe(BaseSlapRecipe):
self.path_list.extend(zc.buildout.easy_install.scripts([ self.path_list.extend(zc.buildout.easy_install.scripts([
('certificate_authority', __name__ + '.certificate_authority', ('certificate_authority', __name__ + '.certificate_authority',
'runCertificateAuthority')], 'runCertificateAuthority')],
self.ws, sys.executable, self.wrapper_directory, arguments=[dict( self.ws, sys.executable, self.service_directory, arguments=[dict(
openssl_configuration=openssl_configuration, openssl_configuration=openssl_configuration,
openssl_binary=self.options['openssl_binary'], openssl_binary=self.options['openssl_binary'],
certificate=os.path.join(self.ca_dir, 'cacert.pem'), certificate=os.path.join(self.ca_dir, 'cacert.pem'),
...@@ -432,7 +435,7 @@ class Recipe(BaseSlapRecipe): ...@@ -432,7 +435,7 @@ class Recipe(BaseSlapRecipe):
environment = dict(PATH=self.options["binutils_directory"]) environment = dict(PATH=self.options["binutils_directory"])
wrapper = zc.buildout.easy_install.scripts([(name, wrapper = zc.buildout.easy_install.scripts([(name,
'slapos.recipe.librecipe.execute', 'executee')], self.ws, 'slapos.recipe.librecipe.execute', 'executee')], self.ws,
sys.executable, self.wrapper_directory, arguments=[varnish_argument_list, sys.executable, self.service_directory, arguments=[varnish_argument_list,
environment])[0] environment])[0]
self.path_list.append(wrapper) self.path_list.append(wrapper)
...@@ -471,7 +474,7 @@ class Recipe(BaseSlapRecipe): ...@@ -471,7 +474,7 @@ class Recipe(BaseSlapRecipe):
stunnel_conf)) stunnel_conf))
wrapper = zc.buildout.easy_install.scripts([('stunnel', wrapper = zc.buildout.easy_install.scripts([('stunnel',
'slapos.recipe.librecipe.execute', 'execute_wait')], self.ws, 'slapos.recipe.librecipe.execute', 'execute_wait')], self.ws,
sys.executable, self.wrapper_directory, arguments=[ sys.executable, self.service_directory, arguments=[
[self.options['stunnel_binary'].strip(), stunnel_conf_path], [self.options['stunnel_binary'].strip(), stunnel_conf_path],
[certificate, key]] [certificate, key]]
)[0] )[0]
...@@ -582,7 +585,7 @@ class Recipe(BaseSlapRecipe): ...@@ -582,7 +585,7 @@ class Recipe(BaseSlapRecipe):
self.path_list.extend(zc.buildout.easy_install.scripts([( self.path_list.extend(zc.buildout.easy_install.scripts([(
'frontend_apache', 'slapos.recipe.erp5.apache', 'runApache')], self.ws, 'frontend_apache', 'slapos.recipe.erp5.apache', 'runApache')], self.ws,
sys.executable, self.wrapper_directory, arguments=[ sys.executable, self.service_directory, arguments=[
dict( dict(
required_path_list=[key, certificate], required_path_list=[key, certificate],
binary=self.options['httpd_binary'], binary=self.options['httpd_binary'],
......
...@@ -46,6 +46,6 @@ eggs = ...@@ -46,6 +46,6 @@ eggs =
# Default template for apache instance. # Default template for apache instance.
recipe = slapos.recipe.template recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance.cfg url = ${:_profile_base_location_}/instance.cfg
md5sum = afc04aa7b87885fc6c219fa7b54eb2c2 md5sum = fea902a2b9dbf8c80ff201bcf73f9396
output = ${buildout:directory}/template.cfg output = ${buildout:directory}/template.cfg
mode = 0644 mode = 0644
\ No newline at end of file
[buildout] [buildout]
parts = parts =
directory
instance instance
configtest configtest
...@@ -13,6 +14,7 @@ etc = $${buildout:directory}/etc/ ...@@ -13,6 +14,7 @@ etc = $${buildout:directory}/etc/
var = $${buildout:directory}/var/ var = $${buildout:directory}/var/
srv = $${buildout:directory}/srv/ srv = $${buildout:directory}/srv/
bin = $${buildout:directory}/bin/ bin = $${buildout:directory}/bin/
service = $${:etc}/service
# Deploy Apache (old way, with monolithic recipe) # Deploy Apache (old way, with monolithic recipe)
......
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