From fd2a2dad8715ca857d4df3eec7e5b78ad5768b72 Mon Sep 17 00:00:00 2001 From: Sam Date: Sat, 14 Nov 2026 18:46:58 +0800 Subject: [PATCH] Fixed rpcd issue --- router/mihomo-kit.sh | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/router/mihomo-kit.sh b/router/mihomo-kit.sh index fc0662b..b78dc9c 100755 --- a/router/mihomo-kit.sh +++ b/router/mihomo-kit.sh @@ -1804,9 +1804,18 @@ install_luci() { rm -rf /tmp/luci-indexcache* /tmp/luci-modulecache log "LuCI page installed: Services -> mihomo-kit" [ "$_rpcd" = 1 ] || return 0 - # rpcd loads plugins only on start; delayed so a job started from LuCI - # (kit update) gets to finish first - (sleep 5; /etc/init.d/rpcd restart) < /dev/null > /dev/null 2>&1 & + # rpcd loads plugins and ACLs only on start. Not "rpcd restart": run from a job LuCI + # started (kit update) this shell is rpcd's descendant, and the stop can take it down + # before the start - rpcd stays dead, LuCI says "Object not found" and rejects the + # password until a reboot. SIGHUP (through procd: to rpcd itself, not its plugins) + # makes rpcd re-exec in place and keep the LuCI sessions; then make sure it runs. + # Delayed so the job gets to finish first. + ( + sleep 5 + ubus call service signal '{"name":"rpcd","signal":1}' || kill -HUP "$(pidof rpcd | cut -d' ' -f1)" + sleep 5 + pidof rpcd || /etc/init.d/rpcd start + ) < /dev/null > /dev/null 2>&1 & } enable_otp_cron() {