From 2f839542554a6383ca0eb53fba119a2e24dc192f Mon Sep 17 00:00:00 2001 From: Dushnilin Date: Fri, 4 Sep 2026 17:15:52 +0300 Subject: [PATCH] fix(updates): resolve service restart timeout and LuCI session drop on upgrade (1.3.20) --- tachyon/files/usr/lib/components/action.uc | 22 +++++++++++++--------- tachyon/files/usr/lib/service/package.uc | 4 +--- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/tachyon/files/usr/lib/components/action.uc b/tachyon/files/usr/lib/components/action.uc index 75fdfec5..57bf4d2d 100644 --- a/tachyon/files/usr/lib/components/action.uc +++ b/tachyon/files/usr/lib/components/action.uc @@ -975,7 +975,7 @@ function restart_tachyon_after_successful_change() { system(kill_matching_command("-E '99-tachyon-wan|flock 1000|init[.]d/tachyon'")); // Kill orphaned logread -f processes before restart to prevent FD cascade. command_success_from_args([ "killall", "logread" ]); - run_logged("Restarting Tachyon after successful component change", command_from_args([ SERVICE_INIT, "restart" ]), 25); + run_logged("Restarting Tachyon after successful component change", command_from_args([ SERVICE_INIT, "restart" ]), 120); } function stop_tachyon_before_sing_box_change() { @@ -2453,11 +2453,13 @@ function reinstall_tachyon() { remove_file("/var/luci-indexcache"); command_success("rm -f /var/luci-indexcache* /tmp/luci-indexcache* 2>/dev/null"); command_success("rm -rf /tmp/luci-modulecache/ 2>/dev/null"); - if (file_exists("/etc/init.d/rpcd") && !command_success_from_args([ "/etc/init.d/rpcd", "reload" ])) - command_success_from_args([ "/etc/init.d/rpcd", "restart" ]); - command_success_from_args([ "killall", "-HUP", "rpcd" ]); + if (file_exists("/etc/init.d/rpcd")) + command_success_from_args([ "/etc/init.d/rpcd", "reload" ]); - restart_tachyon_after_successful_change(); + if (!tachyon_status_running_with_timeout()) + restart_tachyon_after_successful_change(); + else + updates_log("Tachyon is already running after package installation"); clear_version_caches(); let new_version = installed_package_version("tachyon"); if (new_version == "") @@ -2501,11 +2503,13 @@ function install_tachyon() { remove_file("/var/luci-indexcache"); command_success("rm -f /var/luci-indexcache* /tmp/luci-indexcache* 2>/dev/null"); command_success("rm -rf /tmp/luci-modulecache/ 2>/dev/null"); - if (file_exists("/etc/init.d/rpcd") && !command_success_from_args([ "/etc/init.d/rpcd", "reload" ])) - command_success_from_args([ "/etc/init.d/rpcd", "restart" ]); - command_success_from_args([ "killall", "-HUP", "rpcd" ]); + if (file_exists("/etc/init.d/rpcd")) + command_success_from_args([ "/etc/init.d/rpcd", "reload" ]); - restart_tachyon_after_successful_change(); + if (!tachyon_status_running_with_timeout()) + restart_tachyon_after_successful_change(); + else + updates_log("Tachyon is already running after package installation"); clear_version_caches(); let new_version = installed_package_version("tachyon"); if (new_version == "") diff --git a/tachyon/files/usr/lib/service/package.uc b/tachyon/files/usr/lib/service/package.uc index b9e76fa8..d2065410 100644 --- a/tachyon/files/usr/lib/service/package.uc +++ b/tachyon/files/usr/lib/service/package.uc @@ -298,9 +298,7 @@ function luci_postinst() { remove_component_update_cache(); if (!PACKAGE_TEST_MODE) { if (path_exists("/etc/init.d/rpcd")) - command_success_from_args([ "/etc/init.d/rpcd", "restart" ]); - if (path_exists("/etc/init.d/uhttpd")) - command_success_from_args([ "/etc/init.d/uhttpd", "restart" ]); + command_success_from_args([ "/etc/init.d/rpcd", "reload" ]); command_success_from_args([ "logger", "-t", "tachyon", "[info] Package defaults applied" ]); } return true;