run_daemon

Function run_daemon 

Source
pub async fn run_daemon() -> Result<()>
Expand description

Runs the daemon in the foreground.

This is the main entry point for the daemon. It:

  1. Checks if another instance is already running
  2. Sets up logging to a file
  3. Writes the PID file
  4. Starts the file watcher and IPC server
  5. Waits for shutdown signal (SIGTERM/SIGINT or stop command)
  6. Cleans up state files on exit

ยงErrors

Returns an error if:

  • Another daemon instance is already running
  • The database cannot be opened
  • The watcher or server fails to start