uwsgi: add luci-support package

This adds additional specific files to support luci on the nginx

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
This commit is contained in:
Ansuel Smith
2018-06-14 20:37:20 +02:00
parent 10345fbba5
commit c89dc49dfb
3 changed files with 78 additions and 0 deletions
@@ -0,0 +1,26 @@
[uwsgi]
stric = True
plugins = cgi
uwsgi_modifier1 = 9
socket = /var/run/uwsgi.sock
cgi-mode = true
cgi = /www/cgi-bin/luci
chdir = /usr/lib/lua/luci/
master = True
buffer-size = 10000
reload-mercy=8
max-requests=2000
limit-as=200
reload-on-as=256
reload-on-rss=192
no-orphans=True
vacuum=True
enable-threads=True
post-buffering=8192
socket-timeout=120
thunder-lock = True
logger = syslog:uwsgi
daemonize = True
log-format = %(addr) %(method) %(uri) => generated %(rsize) bytes in %(msecs) msecs
pidfile=/var/run/uwsgi.pid
die-on-term=True
@@ -0,0 +1,34 @@
#!/bin/sh /etc/rc.common
START=79
start() {
core_number=$(grep -c ^processor /proc/cpuinfo)
/usr/sbin/uwsgi --ini /etc/uwsgi/uwsgi.conf --threads $core_number --processes $(($core_number * 2))
logger -ts "Uwsgi" "Starting Uwsgi process"
}
stop() {
pidfile="/var/run/uwsgi.pid"
if [ -n "$(pgrep uwsgi)" ]; then
if [ -f $pidfile ]; then
logger -t "Uwsgi" "Stopping Uwsgi process"
kill $( cat $pidfile )
else
for pid in $(pgrep uwsgi); do
if [ -n "$(pgrep uwsgi)" ]; then
#Keep trying to kill until the master process is found
kill -KILL $pid
fi
done
fi
else
logger -t "Uwsgi" "Uwsgi not running!"
fi
}
reload() {
/usr/sbin/uwsgi --reload /var/run/uwsgi.pid
}