Store API sockets in runtime dir

This commit is contained in:
Thales Maciel 2026-01-29 14:59:57 -03:00
parent f8e7aedeb2
commit 68a223c463
No known key found for this signature in database
GPG key ID: 33112E6833C34679
2 changed files with 6 additions and 2 deletions

6
run.sh
View file

@ -169,7 +169,11 @@ VM_TAG="${VM_ID:0:8}"
VM_DIR="$VM_ROOT/$VM_ID"
mkdir -p "$VM_DIR"
API_SOCK="$STATE/fc-$VM_TAG.sock"
RUNTIME_DIR="${XDG_RUNTIME_DIR:-/run/user/$(id -u)}"
SOCK_DIR="$RUNTIME_DIR/banger"
sudo mkdir -p "$SOCK_DIR"
sudo chown "$(id -u):$(id -g)" "$SOCK_DIR"
API_SOCK="$SOCK_DIR/fc-$VM_TAG.sock"
LOG_FILE="$VM_DIR/firecracker.log"
TAP_DEV="tap-fc-$VM_TAG"