Skip to content

Commit 1340230

Browse files
authored
Merge pull request #24 from pilot-protocol/fix/self-update-sudo
fix(deploy): self-updater uses sudo systemctl
2 parents 5fe282b + 2b7605f commit 1340230

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

deploy/scripts/cosift-self-update.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,10 @@ mv -f "$new" "$BIN" # atomic rename over the live path
183183
log "swapped in $latest_tag (previous kept at $prev)"
184184

185185
# --- Restart -------------------------------------------------------------
186+
# Runs as an unprivileged user (User=ubuntu); systemctl needs privilege, and
187+
# ubuntu has passwordless sudo on the box.
186188
log "restarting $SERVICE"
187-
systemctl restart "$SERVICE"
189+
sudo systemctl restart "$SERVICE"
188190

189191
# --- HEALTH GATE ---------------------------------------------------------
190192
# The listener only binds AFTER the ~4-5 min synchronous HNSW load, so a
@@ -209,7 +211,7 @@ fi
209211
err "new version $latest_tag did not become healthy within ${HEALTH_TIMEOUT_S}s — rolling back to $running"
210212
if [[ -f "$prev" ]]; then
211213
mv -f "$prev" "$BIN"
212-
systemctl restart "$SERVICE"
214+
sudo systemctl restart "$SERVICE"
213215
# Give the rolled-back process a chance to come back so the box isn't
214216
# left dark. Best-effort; we still exit non-zero to flag the failure.
215217
rb_deadline=$(( $(date +%s) + HEALTH_TIMEOUT_S ))

0 commit comments

Comments
 (0)