fix(cli): align CLI socket dir default with the server's #16
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "development_fix_cli_sock_default"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
hero_codescalers_serverdefaults--socknameto itsSERVICE_NAMEconstant ("hero_codescalers"), so it createsrpc.sockunder$HERO_SOCKET_DIR/hero_codescalers/. The CLI binary incrates/hero_codescalers/src/main.rswas still using the older"hero_codescalers_server"name, sohero_codescalers <subcommand>with no--serverflag failed:Surfaced today on kristof4 while smoke-testing
hero_codescalers jobs-cleanup --dry-run(the new subcommand from PR #14).Fix
Update
sock_dir_name()to use"hero_codescalers"(or"hero_codescalers_<N>"for non-zero instances) and refresh the doc-comment table to match. One file, ten lines.Verified
All RPC paths (
stats,service.start,jobs.list,jobs.cleanup) work end-to-end via the router URLhttp://[host]:9988/hero_codescalers/rpcafter this change is built and installed.hero_codescalers_server defaults --sockname to SERVICE_NAME ("hero_codescalers"), so it creates rpc.sock under $HERO_SOCKET_DIR/hero_codescalers/. The CLI was still using the older "hero_codescalers_server" name, so 'hero_codescalers <subcommand>' with no --server flag failed: Error: Connection error: Failed to connect to /root/hero/var/sockets/hero_codescalers_server/rpc.sock: No such file or directory Set sock_dir_name() to "hero_codescalers" (or "hero_codescalers_<N>" for non-zero instances) and update the doc-comment table to match.