Skip to content

pitchfork wait ​

  • Usage: pitchfork wait [FLAGS] [ID]…
  • Aliases: w
  • Effect: read-only

Wait for one or more daemons to stop, tailing the logs along the way

Blocks until every specified daemon stops running, while displaying its log output in real-time. Already-finished daemons are evaluated without waiting; their exit codes still count. With no daemon IDs and no --group, shows an interactive picker of the currently running daemons.

A daemon the supervisor restarts (because a watched file changed, or through pitchfork restart / start --force) shows as restarting in between, and waiting follows it to the new process instead of returning. With --exit-on-restart, waiting ends when the daemon is stopped for a restart, and the restart counts as a clean stop (exit 0).

With --kill, an incoming signal (SIGINT/SIGTERM/SIGHUP/SIGQUIT, or Ctrl-C on Windows) first stops the waited daemons via the supervisor (graceful SIGTERM then SIGKILL, hooks fire, reverse dependency order), then the command exits with 128 + the signal number like the shell, so Ctrl-C yields 130.

Exit code: 0 when every waited daemon stopped cleanly. Otherwise the exit code of the first failing daemon (in the order given) is propagated; unknown exit codes, failed daemons, and missing statuses map to 1.

Useful in scripts that need to wait for daemons to complete.

Examples:

pitchfork wait api              Wait for 'api' to stop, exit with its status
pitchfork wait api worker       Wait for 'api' and 'worker' to stop
pitchfork wait --group backend  Wait for the whole 'backend' group
pitchfork wait --kill api       Stop 'api' gracefully when a signal arrives
pitchfork wait --exit-on-restart api
                                Return when 'api' is restarted
pitchfork w api                 Alias for 'wait'
pitchfork wait api && echo done Run command after the daemon stops

Arguments ​

  • [ID]… — The name of the daemon(s) to wait for

Flags ​

  • --group <GROUP> — Wait for all daemons in the named group
  • --kill — Stop the waited daemons when a signal is received while waiting
  • --exit-on-restart — Stop waiting when a daemon is restarted instead of following it to its new process
  • -h --help — Print help
MIT LicenseCopyright © 2026jdx.dev