Browse Source

Merge pull request #6290 from Ansuel/uwsgi-su

uwsgi: add luci-support package
lilik-openwrt-22.03
Hannu Nyman 7 years ago
committed by GitHub
parent
commit
93c6d0fabe
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 78 additions and 0 deletions
  1. +18
    -0
      net/uwsgi-cgi/Makefile
  2. +26
    -0
      net/uwsgi-cgi/files-luci-support/uwsgi.conf
  3. +34
    -0
      net/uwsgi-cgi/files-luci-support/uwsgi.init

+ 18
- 0
net/uwsgi-cgi/Makefile View File

@ -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
- 0
net/uwsgi-cgi/files-luci-support/uwsgi.conf View 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
- 0
net/uwsgi-cgi/files-luci-support/uwsgi.init View 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…
Cancel
Save