feat: socket-activate the hive-c0re admin socket

Add a systemd.sockets.hive-c0re unit that holds /run/hyperhive/host.sock
before hive-c0re starts. hive-c0re serve() detects LISTEN_FDS via the
listenfd crate and accepts the systemd-handed fd instead of calling bind().
Falls back to the existing bind path when LISTEN_FDS is absent so direct
invocation and CI are unaffected.

Benefits: hivectl can connect the moment the socket unit activates (no
racy window), and a hive-c0re restart never drops the socket inode.
This commit is contained in:
atlas 2026-06-01 16:29:41 +02:00
commit f8c0f64fd4
3 changed files with 54 additions and 10 deletions

View file

@ -13,6 +13,7 @@ reqwest.workspace = true
clap.workspace = true
hive-sh4re.workspace = true
libc = "0.2"
listenfd = "1"
rusqlite.workspace = true
serde.workspace = true
serde_json.workspace = true