uwsgi-cgi: introduce emperor mode as default uwsgi installation
authorAnsuel Smith <ansuelsmth@gmail.com>
Thu, 10 Oct 2019 22:30:45 +0000 (00:30 +0200)
committerAnsuel Smith <ansuelsmth@gmail.com>
Fri, 11 Oct 2019 01:38:32 +0000 (03:38 +0200)
- Use uwsgi in emperor mode by default

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
net/uwsgi-cgi/Makefile
net/uwsgi-cgi/files-luci-support/uwsgi.conf [deleted file]
net/uwsgi-cgi/files-luci-support/uwsgi.init [deleted file]
net/uwsgi-cgi/files/emperor.ini [new file with mode: 0644]
net/uwsgi-cgi/files/uwsgi.init [new file with mode: 0644]

index 72f2ef720b6284d9c35cab5ce62c22557e0da0b7..e307184d695b7372415d67c410a47155495c8016 100644 (file)
@@ -51,12 +51,18 @@ endef
 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))
diff --git a/net/uwsgi-cgi/files-luci-support/uwsgi.conf b/net/uwsgi-cgi/files-luci-support/uwsgi.conf
deleted file mode 100644 (file)
index cf48a42..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-[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
diff --git a/net/uwsgi-cgi/files-luci-support/uwsgi.init b/net/uwsgi-cgi/files-luci-support/uwsgi.init
deleted file mode 100644 (file)
index af2a307..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/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
-       }
-
diff --git a/net/uwsgi-cgi/files/emperor.ini b/net/uwsgi-cgi/files/emperor.ini
new file mode 100644 (file)
index 0000000..5baa11b
--- /dev/null
@@ -0,0 +1,10 @@
+[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
diff --git a/net/uwsgi-cgi/files/uwsgi.init b/net/uwsgi-cgi/files/uwsgi.init
new file mode 100644 (file)
index 0000000..98f2c83
--- /dev/null
@@ -0,0 +1,13 @@
+#!/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
+}
+