From 0387f0f62c4b11d266b8fb0e566f6b4979fdd916 Mon Sep 17 00:00:00 2001 From: w-sss <1598099293@qq.com> Date: Tue, 17 Mar 2026 00:32:15 +0800 Subject: [PATCH 1/3] fix(install): install gateway daemon service for fresh installs - Add install_gateway_daemon_if_needed() function - Call daemon install and daemon start for new installs - Skip for upgrades (existing behavior) - Fixes #48272 where gateway was not installed Root cause: The install script only refreshed the gateway service if it was already loaded, but never installed it for fresh installs. Fix: 1. Check if gateway daemon is already installed 2. If not, run 'openclaw daemon install' 3. Then run 'openclaw daemon start' 4. Probe the daemon to verify it's running --- scripts/install.sh | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/scripts/install.sh b/scripts/install.sh index 70c68bf703c..4cd0cd2fd3c 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -2243,6 +2243,45 @@ refresh_gateway_service_if_loaded() { run_quiet_step "Probing gateway service" "$claw" gateway status --deep || true } +install_gateway_daemon_if_needed() { + if [[ "${SKIP_GATEWAY_DAEMON:-0}" == "1" ]]; then + ui_info "Skipping gateway daemon installation (SKIP_GATEWAY_DAEMON=1)" + return 0 + fi + + local claw="${OPENCLAW_BIN:-}" + if [[ -z "$claw" ]]; then + claw="$(resolve_openclaw_bin || true)" + fi + if [[ -z "$claw" ]]; then + ui_info "Skipping gateway daemon install (openclaw not on PATH yet)" + return 0 + fi + + if is_gateway_daemon_loaded "$claw"; then + ui_info "Gateway daemon already installed; skipping install" + return 0 + fi + + ui_info "Installing gateway daemon service" + if run_quiet_step "Installing gateway daemon" "$claw" daemon install; then + ui_success "Gateway daemon service installed" + else + ui_warn "Gateway daemon install failed; user can run 'openclaw daemon install' manually" + return 0 + fi + + if run_quiet_step "Starting gateway daemon" "$claw" daemon start; then + ui_success "Gateway daemon service started" + else + ui_warn "Gateway daemon start failed; user can run 'openclaw daemon start' manually" + return 0 + fi + + sleep 2 + run_quiet_step "Probing gateway daemon" "$claw" daemon status --deep || true +} + verify_installation() { if [[ "${VERIFY_INSTALL}" != "1" ]]; then return 0 @@ -2400,6 +2439,11 @@ main() { fi fi + # Install gateway daemon for fresh installs (not upgrades) + if [[ "$is_upgrade" != "true" ]]; then + install_gateway_daemon_if_needed + fi + refresh_gateway_service_if_loaded # Step 6: Run doctor for migrations on upgrades and git installs From fdb23a41a992584c78e563ca5a4006cfa5cae3cd Mon Sep 17 00:00:00 2001 From: w-sss <1598099293@qq.com> Date: Tue, 17 Mar 2026 10:24:58 +0800 Subject: [PATCH 2/3] fix(install): guard refresh_gateway_service_if_loaded to prevent double restart - Only call refresh_gateway_service_if_loaded on upgrades - Skip for fresh installs (daemon was just installed and started) - Fixes Greptile review feedback --- scripts/install.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/install.sh b/scripts/install.sh index 4cd0cd2fd3c..be9914aa237 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -2442,10 +2442,11 @@ main() { # Install gateway daemon for fresh installs (not upgrades) if [[ "$is_upgrade" != "true" ]]; then install_gateway_daemon_if_needed + else + # Only refresh gateway service on upgrades (not fresh installs) + refresh_gateway_service_if_loaded fi - refresh_gateway_service_if_loaded - # Step 6: Run doctor for migrations on upgrades and git installs local run_doctor_after=false if [[ "$is_upgrade" == "true" || "$INSTALL_METHOD" == "git" ]]; then From f1354e813ed9ccf4e688b08b391fc74b5c92d054 Mon Sep 17 00:00:00 2001 From: w-sss <1598099293@qq.com> Date: Wed, 18 Mar 2026 08:03:05 +0800 Subject: [PATCH 3/3] chore: trigger CI to verify pre-existing Windows test failures This is an empty commit to verify that Windows test failures are pre-existing on the main branch and not caused by this PR's changes. Related: main branch CI is also failing (Install Smoke, Docker Release) See: https://github.com/openclaw/openclaw/actions/runs?query=branch%3Amain