Skip to main content

default_database_path

Function default_database_path 

Source
pub fn default_database_path() -> PathBuf
Expand description

Resolve the daemon SQLite database path for the current process.

Order of precedence:

  1. $SYSKNIFE_DATABASE_PATH (set by systemd unit and sysknife-setup)
  2. $XDG_STATE_HOME/sysknife/daemon.sqlite (per-user, persistent)
  3. $HOME/.local/state/sysknife/daemon.sqlite (XDG fallback)
  4. PRODUCTION_DATABASE_PATH if HOME is unset (production case where systemd sets the env var anyway, so this branch is rarely hit)