Commit 185ad573 authored by Viktor Horvath's avatar Viktor Horvath

Mioga2 Notifier works (for example: updating a gallery.)

parent 59fdcbf3
...@@ -75,8 +75,10 @@ class Recipe(GenericBaseRecipe): ...@@ -75,8 +75,10 @@ class Recipe(GenericBaseRecipe):
fm.modify('maildir', os.path.join(vardir, 'spool', 'mioga', 'maildir')) fm.modify('maildir', os.path.join(vardir, 'spool', 'mioga', 'maildir'))
fm.modify('maildirerror', os.path.join(vardir, 'spool', 'mioga', 'error')) fm.modify('maildirerror', os.path.join(vardir, 'spool', 'mioga', 'error'))
fm.modify('mailfifo', os.path.join(vardir, 'spool', 'mioga', 'fifo')) fm.modify('mailfifo', os.path.join(vardir, 'spool', 'mioga', 'fifo'))
fm.modify('notifierfifo', os.path.join(vardir, 'spool', 'mioga', 'notifier')) notifier_fifo = os.path.join(vardir, 'spool', 'mioga', 'notifier')
fm.modify('searchenginefifo', os.path.join(vardir, 'spool', 'mioga', 'searchengine')) fm.modify('notifierfifo', notifier_fifo)
searchengine_fifo = os.path.join(vardir, 'spool', 'mioga', 'searchengine')
fm.modify('searchenginefifo', searchengine_fifo)
fm.modify('dbi_passwd', self.options['db_password']) fm.modify('dbi_passwd', self.options['db_password'])
fm.modify('db_host', self.options['db_host']) fm.modify('db_host', self.options['db_host'])
fm.modify('db_port', self.options['db_port']) fm.modify('db_port', self.options['db_port'])
...@@ -89,6 +91,7 @@ class Recipe(GenericBaseRecipe): ...@@ -89,6 +91,7 @@ class Recipe(GenericBaseRecipe):
if os.path.isdir('web/conf/apache'): if os.path.isdir('web/conf/apache'):
shutil.rmtree('web/conf/apache') shutil.rmtree('web/conf/apache')
environ = os.environ environ = os.environ
environ['PATH'] = ':'.join([self.options['perl_bin'], # priority! environ['PATH'] = ':'.join([self.options['perl_bin'], # priority!
self.options['mioga_add_to_path'], self.options['mioga_add_to_path'],
...@@ -189,12 +192,30 @@ Include conf/extra/httpd-autoindex.conf ...@@ -189,12 +192,30 @@ Include conf/extra/httpd-autoindex.conf
# ) # )
path_list.append(os.path.abspath(self.options['httpd_conf'])) path_list.append(os.path.abspath(self.options['httpd_conf']))
wrapper = self.createPythonScript(self.options['wrapper'], services_dir = self.options['services_dir']
httpd_wrapper = self.createPythonScript(
os.path.join(services_dir, 'httpd_wrapper'),
'slapos.recipe.librecipe.execute.execute', 'slapos.recipe.librecipe.execute.execute',
[self.options['httpd_binary'], '-f', self.options['httpd_conf'], [self.options['httpd_binary'], '-f', self.options['httpd_conf'],
'-DFOREGROUND'] '-DFOREGROUND']
) )
path_list.append(wrapper) path_list.append(httpd_wrapper)
for fifo in [notifier_fifo, searchengine_fifo]:
if os.path.exists(fifo):
if not stat.S_ISFIFO(os.stat(fifo).st_mode):
raise Exception("The file "+fifo+" exists but is not a FIFO.")
else:
os.mkfifo(fifo, 0600)
notifier_wrapper = self.createPythonScript(
os.path.join(services_dir, 'notifier_wrapper'),
'slapos.recipe.librecipe.execute.execute',
[ os.path.join(self.options['mioga_compile_dir'], 'bin', 'notifier', 'notifier.pl'),
os.path.join(mioga_base, 'conf', 'Mioga.conf') ]
)
path_list.append(notifier_wrapper)
if os.path.exists(self.options['pid_file']): if os.path.exists(self.options['pid_file']):
# Reload apache configuration # Reload apache configuration
......
...@@ -78,6 +78,6 @@ httpd_conf = $${rootdirectory:etc}/httpd.conf ...@@ -78,6 +78,6 @@ httpd_conf = $${rootdirectory:etc}/httpd.conf
pid_file = $${basedirectory:services}/apache.pid pid_file = $${basedirectory:services}/apache.pid
lock_file = $${basedirectory:services}/apache.lock lock_file = $${basedirectory:services}/apache.lock
dav_locks = $${rootdirectory:var}/dav_locks dav_locks = $${rootdirectory:var}/dav_locks
wrapper = $${basedirectory:services}/httpd_wrapper services_dir = $${basedirectory:services}
error_log = $${rootdirectory:log}/error.log error_log = $${rootdirectory:log}/error.log
access_log = $${rootdirectory:log}/access.log access_log = $${rootdirectory:log}/access.log
This source diff could not be displayed because it is too large. You can view the blob instead.
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