Skip to content

Commit a6dcc90

Browse files
committed
fix: lsof and curl promoted to required — status/stop/health check depend on them
1 parent a0cf4fa commit a6dcc90

1 file changed

Lines changed: 11 additions & 8 deletions

File tree

‎cmd/tow/cmd_monitor.go‎

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -639,10 +639,10 @@ func newDoctorCmd() *cobra.Command {
639639
srv := env.Servers[0]
640640
depCheck := `
641641
MISSING=""
642-
for cmd in bash tar; do
642+
for cmd in bash tar lsof curl; do
643643
command -v $cmd >/dev/null 2>&1 || MISSING="$MISSING $cmd(REQUIRED)"
644644
done
645-
for cmd in lsof curl nc; do
645+
for cmd in nc; do
646646
command -v $cmd >/dev/null 2>&1 || MISSING="$MISSING $cmd(recommended)"
647647
done
648648
if [ -z "$MISSING" ]; then
@@ -681,16 +681,19 @@ fi
681681
}
682682

683683
if strings.Contains(p, "REQUIRED") {
684-
fmt.Printf(" %s✗ %s — required. Fix: %s%s\n", logger.ColorRed, toolName, installCmd, logger.ColorReset)
685-
} else {
686684
impact := ""
687685
switch toolName {
688-
case "nc":
689-
impact = " → affects: tow start (TCP health check falls back to bash /dev/tcp)"
690686
case "lsof":
691-
impact = " → affects: tow status, tow stop, tow threaddump (PID detection by port)"
687+
impact = " — tow status, tow stop, tow threaddump will not work"
692688
case "curl":
693-
impact = " → affects: tow start (HTTP health check), tow doctor (HTTP endpoint check)"
689+
impact = " — tow start (HTTP health check), tow doctor will not work"
690+
}
691+
fmt.Printf(" %s✗ %s — required%s. Fix: %s%s\n", logger.ColorRed, toolName, impact, installCmd, logger.ColorReset)
692+
} else {
693+
impact := ""
694+
switch toolName {
695+
case "nc":
696+
impact = " → tow start TCP health check falls back to bash /dev/tcp"
694697
}
695698
fmt.Printf(" %s! %s — recommended%s. Fix: %s%s\n", logger.ColorYellow, toolName, impact, installCmd, logger.ColorReset)
696699
}

0 commit comments

Comments
 (0)