-
Notifications
You must be signed in to change notification settings - Fork 1k
Description
Reading through the watchman docs, it seems that they were written before watchman was ported to Windows?
Example 1:
Watchman looks for configuration files in two places:
- The global configuration file
/etc/watchman.json- The root specific configuration file
.watchmanconfig
Example 2:
Quick note on default locations
Watchman will prefer to resolve your user name from the
$USERenvironmental variable, or$LOGNAMEif$USERwas not set. If neither are set watchman will look it up from the system usinggetpwuid(getuid()). When we refer to<USER>in this documentation we mean the result of this resolution.In some cases Watchman will need to create files in a temporary location. Watchman will resolve this temporary location by looking at the
$TMPDIRenvironmental variable, or$TMPif$TMPDIRwas not set. If neither are set watchman will use/tmp. When we refer to<TMPDIR>in this documentation we mean the result of this resolution.Watchman tracks its persistent state in a location that we refer to as the
<STATEDIR>in this documentation.Since 3.1.
The
STATEDIRdefaulted to<PREFIX>/var/run/watchman. You can change this default when you build watchman by using the configure option--enable-statedir.Earlier versions of Watchman didn't have a default statedir and would instead use the
<TMPDIR>for this state. We switched away from that because some environments randomize the<TMPDIR>location and this made it difficult for clients to locate the Watchman service.Since 3.8.
The
STATEDIRdefaults to<PREFIX>/var/run/watchman/<USER>-state. You can change this default when you build watchman by using the configure option--enable-statedir; the configure option replaces the<PREFIX>/var/run/watchmanportion of this string. If you specify--disable-statedirthen that portion of the string will be computed from the<TMPDIR>location.Watchman will create the
<USER>-stateportion if it does not exist, and will perform some permission and ownership checks to reduce the risk of untrusted users placing files in this location. If those checks are not satisfied, watchman will refuse to start.Locating the service
-U, --sockname=PATH Specify alternate socknameThe default location for sockname will be
<STATEDIR>/<USER>. Older versions of Watchman would default to<TMPDIR>/.watchman.<USER>, depending on how it was configured.If you are building a client to access the service programmatically, we recommend that you invoke watchman get-sockname to discover the path that the client and server would use. This has the side effect of spawning the service for you if it isn't already running.