|
@@ -5,6 +5,7 @@ import sys
|
5
|
5
|
import shlex
|
6
|
6
|
from lodel.plugin import LodelHook
|
7
|
7
|
from lodel.settings import Settings
|
|
8
|
+from lodel import buildconf
|
8
|
9
|
|
9
|
10
|
PLUGIN_PATH = os.path.dirname(__file__)
|
10
|
11
|
|
|
@@ -22,18 +23,27 @@ def uwsgi_fork(hook_name, caller, payload):
|
22
|
23
|
if standalone.lower() == 'false':
|
23
|
24
|
return
|
24
|
25
|
else:
|
|
26
|
+ sockfile = os.path.join(buildconf.LODEL2VARDIR, 'uwsgi_sockets/')
|
|
27
|
+ if not os.path.isdir(sockfile):
|
|
28
|
+ os.mkdir(sockfile)
|
|
29
|
+ sockfile = os.path.join(sockfile,
|
|
30
|
+ Settings.sitename.replace('/','_') + '.sock')
|
25
|
31
|
if standalone.lower() == 'true':
|
26
|
|
- cmd='{uwsgi} --http-socket {addr}:{port} --module plugins.webui.run'
|
|
32
|
+ cmd='{uwsgi} --http-socket {addr}:{port} --module \
|
|
33
|
+plugins.webui.run --socket {sockfile}'
|
27
|
34
|
cmd = cmd.format(
|
28
|
35
|
addr = Settings.webui.listen_address,
|
29
|
36
|
port = Settings.webui.listen_port,
|
30
|
|
- uwsgi= Settings.webui.uwsgicmd)
|
|
37
|
+ uwsgi= Settings.webui.uwsgicmd,
|
|
38
|
+ sockfile=sockfile)
|
31
|
39
|
if Settings.webui.virtualenv is not None:
|
32
|
40
|
cmd += " --virtualenv %s" % Settings.webui.virtualenv
|
33
|
41
|
|
34
|
42
|
elif Settings.webui.standalone == 'uwsgi':
|
35
|
|
- cmd = '{uwsgi} --ini ./plugins/webui/uwsgi/uwsgi.ini'
|
36
|
|
- cmd = cmd.format(uwsgi = Settings.webui.uwsgicmd)
|
|
43
|
+ cmd = '{uwsgi} --ini ./plugins/webui/uwsgi/uwsgi.ini \
|
|
44
|
+--socket {sockfile}'
|
|
45
|
+ cmd = cmd.format(uwsgi = Settings.webui.uwsgicmd,
|
|
46
|
+ sockfile = sockfile)
|
37
|
47
|
|
38
|
48
|
try:
|
39
|
49
|
args = shlex.split(cmd)
|