define Package/uwsgi-cgi/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/uwsgi $(1)/usr/sbin/
+
+ $(INSTALL_DIR) $(1)/etc/init.d
+ $(INSTALL_BIN) ./files/uwsgi.init $(1)/etc/init.d/uwsgi
+
+ $(INSTALL_DIR) $(1)/etc/uwsgi
+ $(INSTALL_DATA) ./files/emperor.ini $(1)/etc/uwsgi/emperor.ini
+
+ $(INSTALL_DIR) $(1)/etc/uwsgi/vassals
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_BIN) ./files-luci-support/uwsgi.conf $(1)/etc/uwsgi.conf
+
endef
$(eval $(call BuildPackage,uwsgi-cgi))
+++ /dev/null
-[uwsgi]
-strict = true
-socket = /var/run/uwsgi.sock
-cgi-mode = true
-cgi = /www/
-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
-disable-logging = true
-log-format = %(addr) %(method) %(uri) => generated %(rsize) bytes in %(msecs) msecs
-pidfile = /var/run/uwsgi.pid
-die-on-term = true
-threads = 3
-processes = 3
-chmod-socket = 666
+++ /dev/null
-#!/bin/sh /etc/rc.common
-
-START=79
-USE_PROCD=1
-
-start_service() {
- procd_open_instance
- procd_set_param command /usr/sbin/uwsgi --ini /etc/uwsgi.conf
- procd_set_param file /etc/uwsgi.conf
- procd_set_param respawn
- procd_close_instance
- }
-
--- /dev/null
+[uwsgi]
+strict = true
+pidfile = /var/run/uwsgi.pid
+emperor = /etc/uwsgi/vassals/*.ini
+logger = syslog:uwsgi-emperor
+vacuum = true
+emperor-on-demand-directory = /var/run/
+emperor-required-heartbeat = 99
+vassal-set = die-on-idle=true
+#disable-logging = true
\ No newline at end of file
--- /dev/null
+#!/bin/sh /etc/rc.common
+
+START=79
+USE_PROCD=1
+
+start_service() {
+ procd_open_instance
+ procd_set_param command /usr/sbin/uwsgi --ini /etc/uwsgi/emperor.ini
+ procd_set_param file /etc/uwsgi/emperor.ini
+ procd_set_param respawn
+ procd_close_instance
+}
+