Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Stopping fsmonitor daemons

drawbar gc-daemons lists your running git fsmonitor--daemon processes, one line each, and stops the ones drawbar no longer wants running:

$ drawbar gc-daemons
4102 kept /home/acme/src/monorepo: left running
4177 below-threshold /home/acme/src/widgets (212 tracked files, under 3000): stopped
4230 excluded /home/acme/src/vendored (fsmonitor.exclude): stopped
4391 orphaned /home/acme/wt/old-branch (working tree is gone): stopped with SIGTERM

Each line gives the PID, the verdict, the working tree, and what happened.

VerdictMeaningStopped
orphanedIts git dir or working tree is gone, or the working tree path now holds another directory, as after a move.Yes
excludedAn exclude entry covers the repository, or mode is "never".Yes
below-thresholdmode is "auto", no include entry covers the repository, and its index holds fewer than min_tracked_files entries.Yes
keptThe rules in Which repositories get fsmonitor still qualify the repository, or its index cannot be read.No
unknowndrawbar cannot tell which repository the daemon serves, as when a daemon in a deeply nested repository has lost its working tree.No

The verdicts come from the rules the shim uses, so the two never disagree about a repository. drawbar stops a daemon whose repository still exists with git fsmonitor--daemon stop, run by the resolved real git. It sends an orphaned daemon, or one still running five seconds after that, SIGTERM by its exact PID, through a pidfd, only after it checks that the PID still has the same owner, command line, and start time. It never matches processes by name with pkill -f, and it only looks at your own processes.

  • --dry-run, or -n, lists the daemons and stops nothing.
  • Paths after the options limit the run to daemons whose repository lies at or below one of them, as in drawbar gc-daemons ~/src/acme.

It exits 0 when nothing failed, 1 when a daemon could not be stopped, /proc could not be read, or the config file was ignored, and 2 for a bad argument. While the config file is ignored it stops nothing, so a typo cannot stop the daemons your include list keeps. It reads Linux /proc and needs Linux 5.3 or newer; on other platforms it prints that it is not supported.

A repository that turns core.fsmonitor on in its own git config gets its daemon back the next time git runs there, so list it in include if you want it kept. ADR 0006 says how drawbar finds each daemon’s repository.