//! `--mode daemon`: the supervisor process. The interactive client spawns this //! mode (detached) when no daemon is listening. use anyhow::Result; use crate::config; pub fn run_daemon_mode(daemon_socket: Option<&str>) -> Result { let socket_path = config::resolve_daemon_socket_path(daemon_socket); let agent_dir = config::get_agent_dir(); let options = pa_daemon::supervisor::SupervisorOptions { socket_path, agent_dir, }; let runtime = tokio::runtime::Builder::new_multi_thread() .enable_all() .build()?; runtime.block_on(pa_daemon::supervisor::run_supervisor(options))?; Ok(0) }