acme: Get listener name from /proc/PID/exe instead of netstat output
authorToke Høiland-Jørgensen <toke@toke.dk>
Fri, 26 Mar 2021 16:58:33 +0000 (17:58 +0100)
committerToke Høiland-Jørgensen <toke@toke.dk>
Fri, 26 Mar 2021 19:06:34 +0000 (20:06 +0100)
It seems the command name output from netstat can be truncated in weird
ways, so let's get the binary name from /proc instead and use that for
matching which listener we have.

Fixes #15071.

Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
net/acme/Makefile
net/acme/files/run.sh

index 54ee236dbd7a507b7005109a9512326a0ee0d5bf..7940a589d2290b64e8ef7b18f6a5503c488afb13 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=acme
 PKG_VERSION:=2.8.7
-PKG_RELEASE:=5
+PKG_RELEASE:=6
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/acmesh-official/acme.sh/tar.gz/$(PKG_VERSION)?
index 87863b58d42840ce58c20328795231893105b1d5..c2c4a57ebb8a1b41ca413408d7fbafa451aa360f 100644 (file)
@@ -73,7 +73,7 @@ pre_checks()
 
        for listener in $(get_listeners); do
                pid="${listener%/*}"
-               cmd="${listener#*/}"
+               cmd="$(basename $(readlink /proc/$pid/exe))"
 
                case "$cmd" in
                        uhttpd)
@@ -100,7 +100,7 @@ pre_checks()
                                        return 1
                                fi
                                ;;
-                       nginx*)
+                       nginx)
                                if [ "$NGINX_WEBSERVER" -eq "1" ]; then
                                        debug "Already handled nginx; skipping"
                                        continue