fix: proxyctl logs no longer hangs
logs command was using journalctl -f (follow) which blocks forever. Split into three commands: - logs [N]: show last N lines and exit (default 30) - logs-follow [N]: tail + follow (old behavior) - logs-all: full dump
This commit is contained in:
@@ -24,8 +24,9 @@ usage() {
|
|||||||
echo -e " ${CYAN}restart${NC} Rebuild + restart"
|
echo -e " ${CYAN}restart${NC} Rebuild + restart"
|
||||||
echo -e " ${CYAN}rebuild${NC} Build release binary only"
|
echo -e " ${CYAN}rebuild${NC} Build release binary only"
|
||||||
echo -e " ${CYAN}status${NC} Service status + quota + usage"
|
echo -e " ${CYAN}status${NC} Service status + quota + usage"
|
||||||
echo -e " ${CYAN}logs${NC} [N] Tail last N lines (default 30) + follow"
|
echo -e " ${CYAN}logs${NC} [N] Show last N lines (default 30)"
|
||||||
echo -e " ${CYAN}logs-all${NC} Full log dump (no follow)"
|
echo -e " ${CYAN}logs-follow${NC} [N] Tail last N lines + follow"
|
||||||
|
echo -e " ${CYAN}logs-all${NC} Full log dump"
|
||||||
echo -e " ${CYAN}test${NC} [msg] Quick test request (gemini-3-flash)"
|
echo -e " ${CYAN}test${NC} [msg] Quick test request (gemini-3-flash)"
|
||||||
echo -e " ${CYAN}health${NC} Health check"
|
echo -e " ${CYAN}health${NC} Health check"
|
||||||
echo ""
|
echo ""
|
||||||
@@ -91,6 +92,11 @@ do_status() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
do_logs() {
|
do_logs() {
|
||||||
|
local lines="${1:-30}"
|
||||||
|
journalctl --user -u "$SERVICE" --no-pager -n "$lines"
|
||||||
|
}
|
||||||
|
|
||||||
|
do_logs_follow() {
|
||||||
local lines="${1:-30}"
|
local lines="${1:-30}"
|
||||||
journalctl --user -u "$SERVICE" --no-pager -n "$lines" -f
|
journalctl --user -u "$SERVICE" --no-pager -n "$lines" -f
|
||||||
}
|
}
|
||||||
@@ -123,8 +129,9 @@ case "${1:-}" in
|
|||||||
restart) do_restart ;;
|
restart) do_restart ;;
|
||||||
rebuild) do_build ;;
|
rebuild) do_build ;;
|
||||||
status) do_status ;;
|
status) do_status ;;
|
||||||
logs) do_logs "${2:-30}" ;;
|
logs) do_logs "${2:-30}" ;;
|
||||||
logs-all) do_logs_all ;;
|
logs-follow) do_logs_follow "${2:-30}" ;;
|
||||||
|
logs-all) do_logs_all ;;
|
||||||
test) do_test "${2:-}" ;;
|
test) do_test "${2:-}" ;;
|
||||||
health) do_health ;;
|
health) do_health ;;
|
||||||
*) usage ;;
|
*) usage ;;
|
||||||
|
|||||||
Reference in New Issue
Block a user