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
$(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))
\ No newline at end of file
--- /dev/null
+[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
\ No newline at end of file
--- /dev/null
+#!/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
+}
+
+