hapostgres / pg_auto_failover

Postgres extension and service for automated failover and high-availability
Other
1.07k stars 112 forks source link

Please honor $XDG_STATE_HOME #935

Closed Tiago-Anastacio closed 1 year ago

Tiago-Anastacio commented 1 year ago

Salut Dimitri, on issue: https://github.com/citusdata/pg_auto_failover/issues/908 you state that :

In pg_autoctl we use the XDG Base Directory Specification to determine where to store and read our files. See for instance the following source:

Indeed it works fine for $XDG_RUNTIME_DIR (and recently TMPDIR) also $XDG_CONFIG_HOME works fine for configuration file.

But $XDG_STATE_HOME is not honored, everything is written to ~/.local

Could you please fix it ?

Thank you Tiago

DimCitus commented 1 year ago

Try XDG_DATA_HOME.

See https://github.com/citusdata/pg_auto_failover/blob/e5bc71cf84dd7db779238e28ea5478d50ab900c4/src/bin/pg_autoctl/config.c#L54 and around in this file.