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:
parent
10345fbba5
commit
c89dc49dfb
3 changed files with 78 additions and 0 deletions
|
@ -26,6 +26,15 @@ define Package/uwsgi-cgi
|
|||
DEPENDS:=+libopenssl +libpcre +jansson +libuuid +libxml2
|
||||
endef
|
||||
|
||||
define Package/uwsgi-cgi-luci-support
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=Web Servers/Proxies
|
||||
TITLE:=Support files for LuCI on Nginx
|
||||
URL:=http://unbit.com/
|
||||
DEPENDS:=+uwsgi-cgi
|
||||
endef
|
||||
|
||||
define Package/uwsgi-cgi/description
|
||||
The uWSGI project build with cgi profile
|
||||
endef
|
||||
|
@ -39,4 +48,13 @@ define Package/uwsgi-cgi/install
|
|||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/uwsgi $(1)/usr/sbin/
|
||||
endef
|
||||
|
||||
define Package/uwsgi-cgi-luci-support/install
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) ./files-luci-support/uwsgi.init $(1)/etc/init.d/uwsgi
|
||||
$(INSTALL_DIR) $(1)/etc/uwsgi
|
||||
$(INSTALL_BIN) ./files-luci-support/uwsgi.conf $(1)/etc/uwsgi/uwsgi.conf
|
||||
$(INSTALL_DIR) $(1)/etc/nginx
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,uwsgi-cgi))
|
||||
$(eval $(call BuildPackage,uwsgi-cgi-luci-support))
|
26
net/uwsgi-cgi/files-luci-support/uwsgi.conf
Normal file
26
net/uwsgi-cgi/files-luci-support/uwsgi.conf
Normal file
|
@ -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
|
34
net/uwsgi-cgi/files-luci-support/uwsgi.init
Normal file
34
net/uwsgi-cgi/files-luci-support/uwsgi.init
Normal file
|
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in a new issue