From: Ansuel Smith Date: Thu, 10 Oct 2019 22:30:45 +0000 (+0200) Subject: uwsgi-cgi: introduce emperor mode as default uwsgi installation X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=e8a391e9c71e0f666b62dfc525d063b347aaa335;p=feed%2Fpackages.git uwsgi-cgi: introduce emperor mode as default uwsgi installation - Use uwsgi in emperor mode by default Signed-off-by: Ansuel Smith --- diff --git a/net/uwsgi-cgi/Makefile b/net/uwsgi-cgi/Makefile index 72f2ef720b..e307184d69 100644 --- a/net/uwsgi-cgi/Makefile +++ b/net/uwsgi-cgi/Makefile @@ -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 index cf48a42bb0..0000000000 --- a/net/uwsgi-cgi/files-luci-support/uwsgi.conf +++ /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 index af2a307e9a..0000000000 --- a/net/uwsgi-cgi/files-luci-support/uwsgi.init +++ /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 index 0000000000..5baa11bf24 --- /dev/null +++ b/net/uwsgi-cgi/files/emperor.ini @@ -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 index 0000000000..98f2c839cc --- /dev/null +++ b/net/uwsgi-cgi/files/uwsgi.init @@ -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 +} +