Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds two complementary capabilities for managing the
orx updashboard server:-d,--detach) onorx up: Starts the dashboard server in the background as a detached process (usingsetsid), redirecting stdio to~/.local/share/openresearch/orx-up.log, verifying health, and exiting immediately. This allows users to disconnect their terminal or SSH session while keeping the server running.orx downcommand: Stops runningorx updashboard instances regardless of PID. It dynamically detects instances via the localorx-up.jsonpidfile, loopback health endpoint probe, or process table scan, shutting them down gracefully through/api/downand escalating to SIGTERM/SIGKILL if needed.Changes
src/main.rs:-d, --detachoption toUpArgs.Command::Down(DownArgs)subcommand with--port,--remote,-f/--force, and--allflags.src/commands/up.rs:args.detachby spawning a detached process withlibc::setsid()and checking/api/health.UpPidFileguard to record{pid, port}on startup.POST /api/downandPOST /api/shutdownfor graceful shutdown."pid": std::process::id()to the/api/healthresponse.src/commands/down.rs:/proc/psprocess table inspection).--remote <HOST>.src/commands/up_remote.rs:parse_remote_targetfororx down --remote.Test Plan
cargo test --bin orx cli_tests && cargo test --bin orx down::tests(all passed).orx up --port 5899 -dstarts the dashboard in the background and exits 0 immediately.curl http://127.0.0.1:5899/api/healthreturns ok.orx down --port 5899terminates the background server cleanly.cargo fmt --all --checkandcargo clippy --all-targets -- -D warnings.