From b0a2c1c5800c30ecf37311885ce11f244102873e Mon Sep 17 00:00:00 2001 From: Sam Chudnick Date: Sat, 12 Feb 2022 17:54:06 -0500 Subject: Bunch of changes --- .local/bin/kill-libvirtd | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 .local/bin/kill-libvirtd (limited to '.local/bin/kill-libvirtd') diff --git a/.local/bin/kill-libvirtd b/.local/bin/kill-libvirtd new file mode 100755 index 0000000..2ea802d --- /dev/null +++ b/.local/bin/kill-libvirtd @@ -0,0 +1,22 @@ +#!/bin/sh +# Stop all running domains and networks, and then stop all libvirtd daemons + +# Save running domains +rundoms="$(virsh list | grep running | awk '{print $2}')" +for dom in $rundoms +do + virsh managedsave $dom +done + +# Stop network +virsh net-destroy default + +# Stop libvirtd +sudo systemctl stop libvirtd >/dev/null +sudo systemctl stop libvirtd-ro.socket >/dev/null +sudo systemctl stop libvirtd-admin.socket >/dev/null +sudo systemctl stop libvirtd.socket >/dev/null +sudo systemctl stop virtlogd >/dev/null +sudo systemctl stop virtlogd-admin.socket >/dev/null +sudo systemctl stop virtlogd.socket >/dev/null +sudo systemctl stop systemd-machined >/dev/null -- cgit v1.2.3