Skip to main content

spawn_unix_server

Function spawn_unix_server 

Source
pub async fn spawn_unix_server<H: Handler>(
    socket_path: &Path,
    handler: Arc<H>,
    cancel: CancellationToken,
) -> Result<JoinHandle<()>>
Expand description

Bind a Unix socket and serve mgmt requests until cancel fires.

On bind, an existing socket file at socket_path is unlinked first — operators are responsible for ensuring no other vaned is using the path. The socket file’s mode is set to 0600: mgmt access is gated by file-system permissions only, no in-band auth.

On cancellation, the bound socket file is removed before the task returns so a subsequent vaned boot can re-bind cleanly.

§Errors

Bind / chmod / remove-stale-file failures bubble up as std::io::Error.