feat(daemon): lock de instancia única por config dir (flock)
Dos daemons compartiendo el mismo config.toml corren sobre el mismo agentId/agentHash/streamSecret y corrompen el estado de sync del otro. flock advisory en <configDir>/unarr.lock al arrancar: el 2º start se niega con mensaje claro. El kernel suelta el lock al morir el proceso (incluido SIGKILL) → sin problema de lock obsoleto. Scope = config dir, no máquina: un UNARR_CONFIG_DIR distinto (p.ej. el agente dev) tiene su propio lock y corre en paralelo. No bloquea una 2ª instalación con config separada — solo el cross-talk de config compartida.
This commit is contained in:
parent
1e61d1e546
commit
2b9d576aee
5 changed files with 46 additions and 0 deletions
1
go.mod
1
go.mod
|
|
@ -10,6 +10,7 @@ require (
|
|||
github.com/charmbracelet/huh v1.0.0
|
||||
github.com/fatih/color v1.19.0
|
||||
github.com/getsentry/sentry-go v0.44.1
|
||||
github.com/gofrs/flock v0.13.0
|
||||
github.com/google/uuid v1.6.0
|
||||
github.com/huin/goupnp v1.3.0
|
||||
github.com/olekukonko/tablewriter v1.1.4
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue