Files
warewulf/vagrant/export-libvirt-sock.sh
Cédric Clerget 0d041cbbbb Vagrant/Libvirt basic test/dev environment
Signed-off-by: Cédric Clerget <cedric.clerget@gmail.com>
2026-01-08 15:36:14 -07:00

15 lines
397 B
Bash
Executable File

#!/bin/sh
pidfile=".export-libvirt-sock.pid"
pid=$(cat $pidfile 2>/dev/null || true)
if [ "$pid" != "" ]; then
if grep "/var/tmp/libvirt.sock:" /proc/$pid/cmdline >/dev/null 2>&1; then
exit 0
fi
fi
nohup vagrant ssh wwctl -- -o ServerAliveInterval=5 -o ServerAliveCountMax=1 -f -R /var/tmp/libvirt.sock:/var/run/libvirt/libvirt-sock -N >/dev/null 2>&1 &
echo $! > .export-libvirt-sock.pid