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}rebuild${NC} Build release binary only"
|
||||
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-all${NC} Full log dump (no follow)"
|
||||
echo -e " ${CYAN}logs${NC} [N] Show last N lines (default 30)"
|
||||
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}health${NC} Health check"
|
||||
echo ""
|
||||
@@ -91,6 +92,11 @@ do_status() {
|
||||
}
|
||||
|
||||
do_logs() {
|
||||
local lines="${1:-30}"
|
||||
journalctl --user -u "$SERVICE" --no-pager -n "$lines"
|
||||
}
|
||||
|
||||
do_logs_follow() {
|
||||
local lines="${1:-30}"
|
||||
journalctl --user -u "$SERVICE" --no-pager -n "$lines" -f
|
||||
}
|
||||
@@ -124,6 +130,7 @@ case "${1:-}" in
|
||||
rebuild) do_build ;;
|
||||
status) do_status ;;
|
||||
logs) do_logs "${2:-30}" ;;
|
||||
logs-follow) do_logs_follow "${2:-30}" ;;
|
||||
logs-all) do_logs_all ;;
|
||||
test) do_test "${2:-}" ;;
|
||||
health) do_health ;;
|
||||
|
||||
Reference in New Issue
Block a user