Fixed rpcd issue

This commit is contained in:
Sam 2026-11-14 18:46:58 +08:00
parent aa7810354c
commit fd2a2dad87

View File

@ -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() {