@@ -92,6 +92,7 @@ out-of-tree state — every script and unit lives in
9292| [ ` backup.sh ` ] ( backup.sh ) | Hourly: trigger ` /api/admin/snapshot ` , sync to S3, prune local. |
9393| [ ` inspect.sh ` ] ( inspect.sh ) | Read-only SQL via ` /api/admin/sql ` , no server stop. |
9494| [ ` force-rebuild.sh ` ] ( force-rebuild.sh ) | Re-run a deploy of ` $DEPLOY_BRANCH ` even when origin hasn't moved. |
95+ | [ ` restart.sh ` ] ( restart.sh ) | Restart the binary in place with visible before/after state. |
9596| [ ` config/vortex-bench.env.example ` ] ( config/vortex-bench.env.example ) | Template for ` /etc/vortex-bench.env ` . |
9697| [ ` systemd/ ` ] ( systemd/ ) | Unit files installed into ` /etc/systemd/system/ ` . |
9798
@@ -293,73 +294,45 @@ saw when it produced the running binary. If it disagrees with
293294` last-deployed-sha ` , the running process is stale (e.g. a manual
294295binary swap, or systemd is still running an older PID).
295296
296- ### "How do I manually rebuild and restart, outside the timer ?"
297+ ### "How do I manually restart or redeploy ?"
297298
298- You shouldn't normally need this — the deploy timer covers all
299- ordinary cases — but it's useful when you want to test an unmerged
300- branch or recover from a stuck timer. Three knobs:
299+ Three knobs, in increasing order of work done:
301300
302301** (a) Restart the running binary, no rebuild.** Cheapest restart;
303- useful after editing ` /etc/vortex-bench.env ` or recovering from a
304- hung connection.
302+ useful after editing ` /etc/vortex-bench.env ` or recovering from a hung
303+ connection. ` build_sha ` on ` /health ` will be unchanged afterwards.
304+ ` sudo systemctl restart vortex-bench-server ` is silent on success;
305+ prefer the wrapper, which prints before/after state so you actually
306+ see the new pid:
305307
306308``` bash
307- sudo systemctl restart vortex-bench-server
308- journalctl -fu vortex-bench-server # confirm it came up
309- curl -fsS http://127.0.0.1:3000/health | jq # build_sha unchanged
309+ /var/lib/vortex-bench/ops/restart.sh
310310```
311311
312- ** (b) Force a deploy of the configured branch right now.** Triggers
313- exactly the same flow the timer runs, including build, atomic symlink
314- swap, and ` /health ` rollback if anything fails.
312+ Sample output:
315313
316- ``` bash
317- sudo systemctl start vortex-bench-deploy.service
318- journalctl -fu vortex-bench-deploy.service # watch it
319314```
315+ BEFORE:
316+ pid: 12345
317+ started: Wed 2026-05-08 14:30:01 UTC
318+ binary: /var/lib/vortex-bench/bin/vortex-bench-server.20260508T143000Z
319+ /health: {"status":"ok",...,"build_sha":"abc123..."}
320320
321- ** (c) Manually build a binary from the current working tree and
322- install it.** Use this to test a branch that isn't ` $DEPLOY_BRANCH `
323- without flipping the env file. The deploy timer will overwrite your
324- manual binary on the next tick that sees a relevant change, so you
325- probably want to pause it first:
326-
327- ``` bash
328- . /etc/vortex-bench.env
329- sudo systemctl stop vortex-bench-deploy.timer # pause auto-deploy
330- cd " $REPO_DIR "
331- git fetch origin
332- git checkout --force --detach origin/< branch> # pin to whatever you want
333- cargo build --release -p vortex-bench-server
334- ts=$( date -u +%Y%m%dT%H%M%SZ)
335- sudo install -m 0755 -o ec2-user -g ec2-user \
336- target/release/vortex-bench-server \
337- " /var/lib/vortex-bench/bin/vortex-bench-server.manual-${ts} "
338- ln -sfnT " /var/lib/vortex-bench/bin/vortex-bench-server.manual-${ts} " \
339- /var/lib/vortex-bench/bin/vortex-bench-server
340- sudo systemctl restart vortex-bench-server
341- curl -fsS http://127.0.0.1:3000/health | jq .build_sha # verify new SHA
342- # When done testing:
343- sudo systemctl start vortex-bench-deploy.timer # resume auto-deploy
344- ```
321+ running: sudo systemctl restart vortex-bench-server
345322
346- The timer's next fire (within 60s) will overwrite your manual binary
347- with whatever ` origin/$DEPLOY_BRANCH ` produces, which is usually what
348- you want — manual binaries are scratch space, not a long-term state.
323+ AFTER:
324+ pid: 12678 ← different pid proves it restarted
325+ started: Wed 2026-05-08 14:35:42 UTC
326+ binary: /var/lib/vortex-bench/bin/vortex-bench-server.20260508T143000Z
327+ /health: {"status":"ok",...,"build_sha":"abc123..."}
349328
350- ### "How do I manually restart or redeploy?"
351-
352- Three knobs, in increasing order of work done:
353-
354- ** (a) Restart the running binary, no rebuild.** Cheapest restart;
355- useful after editing ` /etc/vortex-bench.env ` or recovering from a hung
356- connection. ` build_sha ` on ` /health ` will be unchanged afterwards.
357-
358- ``` bash
359- sudo systemctl restart vortex-bench-server
360- journalctl -fu vortex-bench-server # confirm it came up
329+ RESTART OK
361330```
362331
332+ The binary path and ` build_sha ` don't change (restart doesn't rebuild);
333+ the ** pid** and ** started** values do. Exit 0 on success, 1 on failure
334+ (with a pointer to ` journalctl ` ) so the script is usable from automation.
335+
363336** (b) Run a deploy now if origin has moved.** Triggers the same flow
364337the 60s timer runs. No-op if ` origin/$DEPLOY_BRANCH ` hasn't moved
365338since the last successful deploy.
0 commit comments