Skip to content

Commit

Permalink
uwsgi ini with txt rather than xml
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Nov 29, 2016
1 parent 9d07bbf commit 9793714
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
4 changes: 3 additions & 1 deletion build.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ password = ${site:supervisor-pass}
serverurl = http://${site:supervisor-host}:${site:supervisor-port}
programs =
0 zeo ${zeoserver:location}/bin/runzeo true ${site:zeo-user}
10 uwsgi ${buildout:directory}/bin/uwsgi [ --ini-paste ${buildout:directory}/production.ini -x ${buildout:directory}/parts/uwsgi/uwsgi.xml --paste-logger] true ${site:zope-user}
10 uwsgi ${buildout:directory}/bin/uwsgi [ --ini-paste ${buildout:directory}/production.ini --ini ${buildout:directory}/parts/uwsgi/uwsgi.txt --paste-logger] true ${site:zope-user}
20 worker ${buildout:directory}/bin/worker [ console ] true ${site:zope-user}
30 transcodedaemon ${buildout:directory}/bin/transcodedaemon [fg] true ${site:transcode-user}
40 ploneftp ${buildout:directory}/bin/ploneftp [fg] true ${site:ftp-user}
Expand Down Expand Up @@ -231,3 +231,5 @@ command =

update-command = ${chown:command}
stop-on-error = false


13 changes: 13 additions & 0 deletions buildout.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ parts +=
omelette

chown
uwsgi-init

plumisite
auto-install-plumisite
Expand Down Expand Up @@ -142,6 +143,7 @@ python-twitter = 1.0
quintagroup.dropdownmenu = 1.2.13

zc.recipe.cmmi = 1.3.5
Products.PloneHotfix20161129 = 1.1


# Default settings for ZEO clients.
Expand Down Expand Up @@ -184,6 +186,7 @@ eggs =
Products.PloneHotfix20150910
Products.PloneHotfix20151208==1.0
Products.PloneHotfix20160419
Products.PloneHotfix20161129
zc.queue
collective.js.jqueryui
edition1.twitterportletfix
Expand Down Expand Up @@ -256,3 +259,13 @@ recipe = collective.recipe.cmd
on_install = true
on_update = false
cmds = ${buildout:directory}/bin/zeoserver start && ${buildout:directory}/bin/plumisite && ${buildout:directory}/bin/zeoserver stop

[uwsgi-init]
# Set the uwsgi init file containing the pythonpath
# unweb.recipe.uwsgi produces an xml file and uwsgi on Debian jessie
# will segfault once started
recipe = plone.recipe.command
command = ${buildout:directory}/bin/python ${buildout:directory}/scripts/uwsgi_init_pythonpath
update-command = ${uwsgi-init:command}
stop-on-error = false

15 changes: 15 additions & 0 deletions scripts/uwsgi_init_pythonpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Read the uwsgi xml file produced by unweb.recipe.uwsgi
# and create txt file with the pythonpath
import re

xml_conf = open('parts/uwsgi/uwsgi.xml').readlines()

init = '[uwsgi]\n'
for line in xml_conf:
m = re.search(r'<pythonpath>(.+?)</pythonpath>', line)
if m:
init += 'pythonpath = %s\n' % m.group(1)

ini_file = open('parts/uwsgi/uwsgi.txt', 'w')
ini_file.write(init)
ini_file.close()

0 comments on commit 9793714

Please sign in to comment.