OS-level single-daemon ownership lock for data_dir.
Uses a short-lived .claim spin directory to serialize lock acquisition,
then binds a Unix domain socket under /tmp (kept within macOS sun_path
limits) and writes <data_dir>/lock.json. Surviving a SIGKILL of a prior
daemon triggers :econnrefused on the stale socket probe, allowing immediate
takeover without manual cleanup.
Summary
Functions
Returns a specification to start this module under a supervisor.
Computes the deterministic Unix domain socket path (<= 100 bytes) for data_dir.
Starts the store lock process for :data_dir.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
Computes the deterministic Unix domain socket path (<= 100 bytes) for data_dir.
@spec start_link(keyword()) :: GenServer.on_start()
Starts the store lock process for :data_dir.
Returns {:error, :store_locked} if another live OS process holds the lock.
Accepts an optional :name to register the GenServer.