From 4d6f8d68a37ca4219e0994ffb5d74a964127ed0b Mon Sep 17 00:00:00 2001 From: Vincent Li Date: Sat, 5 Oct 2024 23:08:30 +0000 Subject: [PATCH] xdp-dns UI: change running state check Status relies on checking if xdp_dns_log is running, but xdp_dns_log could mysteriously disappear at some point, which result in XDP DNS Blocklist shows Stopped, let /etc/rc.d/init.d/xdpdns status relies on if the xdp_dns_denylist XDP program is still attached to green0 interface. two related issues https://github.com/vincentmli/BPFire/issues/50 https://github.com/vincentmli/BPFire/issues/49 Signed-off-by: Vincent Li --- html/cgi-bin/xdpdns.cgi | 2 +- src/initscripts/system/xdpdns | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/html/cgi-bin/xdpdns.cgi b/html/cgi-bin/xdpdns.cgi index c9517ee11..350461f6e 100644 --- a/html/cgi-bin/xdpdns.cgi +++ b/html/cgi-bin/xdpdns.cgi @@ -184,7 +184,7 @@ my $sactive = "> /dev/null + if [ $? -eq 0 ]; then + echo "xdp_dns_denylist is attached to green0" + else + echo "xdp_dns_denylist is not attached to green0" + fi +} + case "$1" in start) @@ -74,7 +83,7 @@ case "$1" in ;; status) - statusproc /usr/sbin/xdp_dns_log + is_xdpdns_attached ;; restart)