openwrt / packages

Community maintained packages for OpenWrt. Documentation for submitting pull requests is in CONTRIBUTING.md
GNU General Public License v2.0
3.89k stars 3.4k forks source link

uwsgi: files/emperor.ini #22793

Open milekey opened 7 months ago

milekey commented 7 months ago

Maintainer: Ansuel Smith ansuelsmth@gmail.com Environment: OpenWrt 23.05.2

Description:

The emperor.ini 's emperor-on-demand-directory value has tailing '/' (slash), I think it may be better off without it.

- emperor-on-demand-directory = /var/run/
+ emperor-on-demand-directory = /var/run

As you see below, some log messages have double slash path as "/var/run//luci-webui.socket":

daemon.err uwsgi[7642]: [uwsgi-emperor] /etc/uwsgi/vassals/luci-cgi_io.ini -> "on demand" instance detected, waiting for connections on socket "/var/run//luci-cgi_io.socket" ...
daemon.err uwsgi[7642]: [uwsgi-emperor] /etc/uwsgi/vassals/luci-webui.ini -> "on demand" instance detected, waiting for connections on socket "/var/run//luci-webui.socket" ...

By such behavior, multiple fds are created for the same socket from taking " /var/run/python-cgi.socket" and "/var/run//python-cgi.socket" are different files.

daemon.err uwsgi[3965]: uwsgi socket 0 bound to UNIX address /var/run/python-cgi.socket fd 3
daemon.err uwsgi[3965]: uwsgi socket 1 inherited UNIX address /var/run//python-cgi.socket fd 0

And sometimes it causes vacuum error:

daemon.err uwsgi[4415]: VACUUM WARNING: unix socket /var/run/python-cgi.socket changed inode. Skip removal
daemon.err uwsgi[4415]: VACUUM WARNING: unix socket /var/run//python-cgi.socket changed inode. Skip removal
brada4 commented 7 months ago

Verified to be true. Please change first line "off with it" to "off without it" ;-) And first section can better be formatted via 3-ticks+diff like:

diff --git a/net/uwsgi/files/emperor.ini b/net/uwsgi/files/emperor.ini
index 9c245af1d..c45177d0d 100644
--- a/net/uwsgi/files/emperor.ini
+++ b/net/uwsgi/files/emperor.ini
@@ -4,6 +4,6 @@ pidfile = /var/run/uwsgi.pid
 emperor = /etc/uwsgi/vassals/*.ini
 early-emperor = true
 vacuum = true
-emperor-on-demand-directory = /var/run/
+emperor-on-demand-directory = /var/run
 emperor-required-heartbeat = 99
 vassal-set = die-on-idle=true
brada4 commented 7 months ago

Ping @Ansuel , thanks.

milekey commented 7 months ago

Verified to be true. Please change first line "off with it" to "off without it" ;-) And first section can better be formatted via 3-ticks+diff like:

diff --git a/net/uwsgi/files/emperor.ini b/net/uwsgi/files/emperor.ini
index 9c245af1d..c45177d0d 100644
--- a/net/uwsgi/files/emperor.ini
+++ b/net/uwsgi/files/emperor.ini
@@ -4,6 +4,6 @@ pidfile = /var/run/uwsgi.pid
 emperor = /etc/uwsgi/vassals/*.ini
 early-emperor = true
 vacuum = true
-emperor-on-demand-directory = /var/run/
+emperor-on-demand-directory = /var/run
 emperor-required-heartbeat = 99
 vassal-set = die-on-idle=true

Thank you, @brada4.

jefferyto commented 7 months ago

This seems like an issue that should be raise with upstream. I think most users would not expect a trailing slash to have any tangible effects like this.