pub async fn run_daemon() -> Result<()>Expand description
Runs the daemon in the foreground.
This is the main entry point for the daemon. It:
- Checks if another instance is already running
- Sets up logging to a file
- Writes the PID file
- Starts the file watcher and IPC server
- Waits for shutdown signal (SIGTERM/SIGINT or stop command)
- 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